Hi. I have just been introduced to string tokenizer in one of the java lessons. It can remove characters from an array of strings. So, I am wondering if it could remove a string from an array of string. For example: "the fish was eaten by the cat". I'd like to remove "the" from this array of string, resulting to: "fish was eaten by cat", without getting all t's, h's and e's from the array of string. Is this possible? :) :roll:
red_evolve 1
Posting Whiz
Recommended Answers
Jump to PostThe String tokenizer doesn't have a method to remove tokens. If you have a string like "the fish was eaten by the cat" rather than going through the overhead of creating more objects, just use the native method "replace" or "replaceall" that comes with the String object. You can replace …
Jump to PostYes. Check out the Java API docs for String:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.htmlThe whole J2SE API:
http://java.sun.com/j2se/1.4.2/docs/api/
Jump to Postguys, help m plz.. i need a java code that separate a number from words..
Be more specific, start a new thread and show what you have done so far
All 13 Replies
sooim3 0
Newbie Poster
samaru 145
a.k.a inscissor Team Colleague
red_evolve 1
Posting Whiz
sooim3 0
Newbie Poster
red_evolve 1
Posting Whiz
samaru 145
a.k.a inscissor Team Colleague
lohengrin332 0
Newbie Poster
red_evolve 1
Posting Whiz
mackverick 0
Newbie Poster
RBDurgin@Gmail 0
Newbie Poster
lonely gurl 0
Newbie Poster
javaAddict 900
Nearly a Senior Poster Team Colleague Featured Poster
skylover87 0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.