I tried to replace characters in String which works sometimes and does not work most of the time.
I tried the following:
String t = \"[javatag]\"; String
String.replace() returns a new string after replacing the required characters. Hence you need to do it in this way:
String t = "[javatag]"; t = t.replace("[",""); t = t.replace("]","");