I have a string value that includes backslash character (\
). My goal is to replace it with the character(_
).
I did the following as per solution provided in this question How to remove the backslash in string using regex in Java?
String x = "2\5\2017";
x = x.replaceAll("\\\\", "_");
but I am always getting (27
) as a value of x
. Note: there is unknown character between 2 and 7. In the console, I can see it as a small square.