Is the best way to check for 2 words of same type in a string to make a stringtokenizer and story every word in an array then compare it in a for loop?
seems like a hassle for comparing for same words i was wondering if theres a better way?
Gink
0
Light Poster
Recommended Answers
Jump to PostString has a split function that's more efficient than StringTokenizer.
But for your problem take a look at regular expressions, they were invented for things like that.
There's a set of functions "indexOf" in String which you can use to look for the starting index of a substring in a …
Jump to Postyou could always use this:
boolean equalsIgnoreCase(String anotherString);
All 6 Replies
jwenting
1,889
duckman
Team Colleague
server_crash
64
Postaholic
jwenting
1,889
duckman
Team Colleague
newtechie
0
Light Poster
sciwizeh
62
Posting Pro in Training
newtechie
0
Light 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.