I want to know how to replace the string in Java.
E.g.
String a = \"adf�sdf\";
How can I replace and avoid special characters?
Assuming, that you want to remove all special characters, you can use the character class \p{Cntrl} Then you only need to use the following code:
stringWithSpecialCharcters.replaceAll("\\p{Cntrl}", replacement);