What\'s the correct regex for a plus character (+) as the first argument (i.e. the string to replace) to Java\'s replaceAll method in the String class? I can\'t
replaceAll
String str="Hello+Hello"; str=str.replaceAll("\\+","-"); System.out.println(str);
OR
String str="Hello+Hello"; str=str.replace(Pattern.quote(str),"_"); System.out.println(str);