mercredi 6 mai 2015

Replacing an \u with \\u in a string using java

I am trying to replace an \u in a url.

C:\testing\bing\utest\university.txt

when i use url=url.replaceAll("\\u", "\\\\u"); I am getting the below error May i know how to replace the \u with \u or escaping the \u

java.util.regex.PatternSyntaxException: Illegal Unicode escape sequence near index 2
\u

Aucun commentaire:

Enregistrer un commentaire