Suppose I have the following in String
format:
2.2
And I want to replace the decimal point with an empty space, to make it look like this:
22
How do I do this? I thought replace
would have done the trick, but when I try it like this:
string.replace('.', '');
I get an error with the ''
because it supposedly isn't a character. That makes sense, so how else can I accomplish what I want?