How to remove the backslash in string using regex in Java?
For example:
hai how are\\ you?
I want only:
hai how are
You can simply use String.replaceAll()
String foo = "hai how are\\ you?"; String bar = foo.replaceAll("\\\\", "");