I am trying to use relaceAll to replace a space with "\\s+" but instead of replacing with desired characters it's considering it as space, Here is my code:
String text = "hello world !".replaceAll("\\s+", "\\\\s+");
My expected output is:
hello\\s+world\\s+!