Hello everyone,
i have a problem using the replaceAll method and i hope that somebody can help. I want to remove substrings (sub) from a string (message). The message string looks like that:
prop(ag1,0,1,4,5)/prop(ag2,2,5,3,3)/prop(ag1,0,1,4,5)....
I want to take each prop(...) and put it in a list, but not the duplicate ones.
So i use
String sub = mess.substring(0,mess.indexOf('/'));
and then
mess=mess.replaceAll(sub,"");
but it doesn't work. I printed the mess after the replacement but it's the same and it hasn't removed the substrings. I tried to replace all the "(" just to check
mess=mess.replaceAll("(","r");
but i got that exception
java.util.regex.PatternSyntaxException: Unlcosed group near index 1
(
^.....
...
Does anyone know what's going on?