| Author |
String manipulation
|
Allen Thomas
Greenhorn
Joined: Jul 02, 2002
Posts: 29
|
|
Hi, Would anyone happen to know how to delete a character out a string without using J2SE 1.4 Example: String aString = "Java is ! cool."; I want to remove the ! and have the string say "Java is cool." Thanks in advance Gregg [ July 26, 2002: Message edited by: Gregg Tomas ]
|
 |
oLi Bou
Greenhorn
Joined: Jul 03, 2002
Posts: 23
|
|
what do u mean by not using the J2SE 1.4 ? The way i would actually do it : dunno if that helps ..
|
--learn every day--
|
 |
Allen Thomas
Greenhorn
Joined: Jul 02, 2002
Posts: 29
|
|
Without J2SE 1.4, meaning not to use the regex api for regular expressions. I will look at your code and try it. Thank you for responding. I will let you know how it works out. Gregg
|
 |
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
|
|
what do u mean by not using the J2SE 1.4 ? Well with 1.4 you could just do something like: aString = aString.replaceAll("!", ""); Obviously that's simpler if you're able to use 1.4 for your application...
|
"I'm not back." - Bill Harding, Twister
|
 |
Allen Thomas
Greenhorn
Joined: Jul 02, 2002
Posts: 29
|
|
oLi, Thanks. It worked out great. I was able to get your code and build from it. Your code is very efficient. Thanks again. Gregg
|
 |
Allen Thomas
Greenhorn
Joined: Jul 02, 2002
Posts: 29
|
|
|
Thanks Jim for your response as well.
|
 |
 |
|
|
subject: String manipulation
|
|
|