How to use Contains - without case sensitivity?
I just registered here now that I'm working on my first "real world" (not book driven) application and I'm stuck with case sensitivity:
It is clear that Names.contains() is case sensitive, but I can't find an "ignore case" or "case insensitive" version - though it seems this should be common enough to be included somewhere. Can you nudge me in the right direction?
// Names holds the names I want to search for.
Set Names = new HashSet<String>();
// (Names is populated by a SQL result set)
// wordlist contains the words from a page of text that I have pulled from a file:
List<String> wordlist = stringToArrayList(pagetext, " ");
for (String word: wordlist)
System.out.print(word + "\t");
Re: How to use Contains - without case sensitivity?
org.apache.commons.lang.StringUtils.containsIgnore Case("AbBaCca", "bac");
Originally Posted by Russell411
use commons api provided by apache.
I also faced this problem and i solved this using the above api.
Now i think it may be proved useful information for you.
Thanks for the quick reply... But I've gotta say, "Yuck!"