How to remove a particular character from string in Java?

To remove a particular character from string in Java, call the String.replace method.

Here is how you can remove all occurrences of character C from this string:

"abCdeCfg".replace('C', ''); // abdefg