I am having string as below and want prefix to be removed [*TESTABC*]
String a = "[*TESTABC*]test@test.com";
Expected result: test@test.com
I tried below code but it is removing the bracklets only. I need to remove the inner content also.
The string with come in this pattern only. Please help.
String s = "[*TESTABC*]test@test.com";
String regex = "\\[|\\]";
s = s.replaceAll(regex, "");
System.out.println(s); //*TESTABC*test@test.com