this is because string.replaceAll() actually works with regular expression patterns. The source of your trouble is that "$" is a reserved character in regex, which matches at the beginning of a line. The "pattern" of "$" is matching the line's start position, but doesn't actually match any text. Consequently, replacing nothing with a blank string does nothing :)
What you'll have to do is escape the "$":
// in Java, of course...
string.replaceAll("\\$", "");
The double escape character is necessary for the backslash to wiggle its way into the regular expression, past Java's own character escaping backslash.
replaceAll() is a regex function
this is because string.replaceAll() actually works with regular expression patterns. The source of your trouble is that "$" is a reserved character in regex, which matches at the beginning of a line. The "pattern" of "$" is matching the line's start position, but doesn't actually match any text. Consequently, replacing nothing with a blank string does nothing :)
What you'll have to do is escape the "$":
// in Java, of course...
string.replaceAll("\\$", "");
The double escape character is necessary for the backslash to wiggle its way into the regular expression, past Java's own character escaping backslash.
Let me know if that fixes it for you!