How to remove special characters in the string except \"- _\". Now I use:
replaceAll(\"[^\\\\w\\\\s]\", \"\")
it remove all special charact
Pattern pt = Pattern.compile("[^a-zA-Z0-9_-]"); Matcher match = pt.matcher(c); while (match.find()) { String s = match.group(); c = c.replaceAll("\\" + s, ""); }
Consider this