java - Wrong output using replaceall -
why "aaaaaaaaa" instead of "1a234a567" following code:
string myst = "1.234.567"; string test = myst.replaceall(".", "a"); system.out.println(test);
any idea?
replaceall
function take regular expression parameter. , regular expression "." means "any character". have escape specify character want : replaceall("\\.", "a")
Comments
Post a Comment