Hi I am getting trouble in replacing the exact string containing # and @ characters.
I tried mytext.replaceAll('\\b('+text+')\\b',"testtest");
also but it also didn't helped.
Exact string means the exact word.
String myStr = "test1 test";
myStr= myStr.replaceAll('\\b('+ Pattern.quote("test") +')\\b',"notest")//out put string "test1 notest"
//Exact word means only "test" is getting replace not "test" from "test1" word to notest1
String myStr1 = "test1 #test";
myStr1 = myStr1.replaceAll('\\b('+Pattern.quote("#test") +')\\b',"notest")//out put string "test1 #test", #test is not replaced
Can some one please help me. Thanks in advance