Possible Duplicate:
Case insensitive string as HashMap key
I have a Hashmap with a String as the key and an integer as the value. Now, I am using the get method to get the values, where the string matches with the key value.
HashMap<String,Integer> map= new HashMap<String,Integer>();
// Populate the map
System.out.println(map.get("mystring"));
I want this string comparison to be case insensitive. Is there anyway I can do that ?
For example, I want it to return the same result in the following cases:
map.get("hello");
map.get("HELLO");
map.get("Hello");