This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "String manipulation" Watch "String manipulation" New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String manipulation
 
Similar Threads
Book Promotion - Pro JSF and Ajax Winners Submitted
Contributing Member status link
selectOneMenu
Anchor title stay for longtime
IDEA 4: Key mappings