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 Post— jwenting 1,905String 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 Post— server_crash 64you could always use this:
boolean equalsIgnoreCase(String anotherString);
All 6 Replies
jwenting 1,905 duckman Team Colleague
server_crash 64 Postaholic
jwenting 1,905 duckman Team Colleague
Member #372918
sciwizeh 62 Posting Pro in Training
Member #372918
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.