Re: String replaceAll doesn't like commas
- From: Jeffrey Schwab <jeff@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 03:14:22 GMT
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 "\\\\,".
.
- Follow-Ups:
- Re: String replaceAll doesn't like commas
- From: Alan Krueger
- Re: String replaceAll doesn't like commas
- References:
- String replaceAll doesn't like commas
- From: O.B.
- String replaceAll doesn't like commas
- Prev by Date: Re: String replaceAll doesn't like commas
- Next by Date: Re: Get a class instances
- Previous by thread: Re: String replaceAll doesn't like commas
- Next by thread: Re: String replaceAll doesn't like commas
- Index(es):