I have a String variable that contains a bunch of $ symbols in it. I want to replace all of the "$" with blank text. I have tried String.replaceAll("$","") but it doesn't work.... does anybody know the regular expression that represents the $ sign?
Originally posted by Srinivas Redd: Why "$" doesn't work ... ??? Why we have to give "[$]" ???
The reason "$" does not work is because it has special meaning in a regular expression. It means the end of the line -- a marker for a carriage return and/or line feed.
BTW, "\\$" or "[$]" should both work.
Henry [ April 06, 2006: Message edited by: Henry Wong ]