Re: String replaceAll doesn't like commas



O.B. wrote:
Why doesn't the following turn "Bubba, Inc." into "Bubba\, Inc."?

String test = "Bubba, Inc.";
test = test.replaceAll(",", "\\,");

The double quotes eat one backslash. The regex parser eats the other. Try "\\\\,".
.