how to remove character from string?

Hi,

I want to remove ',' from a string. I cant find any function in the String class. Wanted to confirm that we have to achieve this programatically.

If not, please let me know of the functions. I dont want a new algorithm..just any existing function provided by Java

Cheers

[301 byte] By [chabhia] at [2007-11-27 3:56:41]
# 1
String.replace() and String.replaceAll(). Note: String is immutable, so these return a new String with the replacements made.
pbrockway2a at 2007-7-12 9:00:55 > top of Java-index,Java Essentials,New To Java...
# 2
String newString = oldString.replaceFirst(",","");If I get any slower I'll be dead!Message was edited by: sabre150
sabre150a at 2007-7-12 9:00:55 > top of Java-index,Java Essentials,New To Java...
# 3
thanks for the responses i achieved using .replaceAll(",", "");thanks for the pointerscheers
chabhia at 2007-7-12 9:00:55 > top of Java-index,Java Essentials,New To Java...
# 4
You're welcome.Note that replaceAll/First use regex (so if you look for something other than ',' there may be problems). The version of replace() using CharSequence arguments is sometimes overlooked - a String is a CharSequence so Strings can be used as arguments.
pbrockway2a at 2007-7-12 9:00:55 > top of Java-index,Java Essentials,New To Java...