M
Matt
I have to believe I'm not the first person to have this question.
However, I'm not having any luck finding a conclusive answer.
FYI, I'm coding in Java 1.5. Say I have the following:
Set<String> a = new HashSet<String>();
Map<String, Object> b = new TreeMap<String, Object>();
Assume somewhere these are populated.
When I check the set for a string using a.contains("bob"), the method is
checking using a case-sensitive search. Similarly, if I did
b.containsKey("tom"), it's case-sensitive.
Is it possible to get these methods to perform a comparison
case-insensitively? Thus, performing:
a.contains("bob")
a.contains("BoB")
a.contains("BOB")
would all yield the same result?
Thanks for your time. Cheers,
Matt
--
However, I'm not having any luck finding a conclusive answer.
FYI, I'm coding in Java 1.5. Say I have the following:
Set<String> a = new HashSet<String>();
Map<String, Object> b = new TreeMap<String, Object>();
Assume somewhere these are populated.
When I check the set for a string using a.contains("bob"), the method is
checking using a case-sensitive search. Similarly, if I did
b.containsKey("tom"), it's case-sensitive.
Is it possible to get these methods to perform a comparison
case-insensitively? Thus, performing:
a.contains("bob")
a.contains("BoB")
a.contains("BOB")
would all yield the same result?
Thanks for your time. Cheers,
Matt
--