I have some code that looks like this:
str.replaceAll('$', ' ');
return str;
What I'm trying to do here is replace every instance of $ in my string str with a space. But I get this error when I compile:
incompatible types: char cannot be converted to String
str.replaceAll('$', ' ');
^
But I'm not converting anything to string, I'm replacing a character by a space character. So why am I getting that error?