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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -