android - Java doesn't work with regex \s, says: invalid escape sequence -
I want to replace all the spacing characters with "ss" with one "+" and all "ß". It works well for "ß", but somehow eclipse will not let me use \ s for a white space. I tried "\ t" instead, but it does not work either .. I get the following error:
< P> This is my code:Invalid save sequence (valid ones are \ b \ t \ n \ f \ r \ "\ '\)
Try {string temp1 = from.getText (). ToString (); start_from = temp1.replaceAll ("ß", "ss"); start_from = start_from .replaceAll ("\ s", "+ +
Thanks in advance!
Why does not this work? Is it Android, Eclipse or what?
Thanks in advance!
You need to avoid slash
start_from = start_from.replaceAll (" \\ s "," + ");
Comments
Post a Comment