How to ignore the case sensitive when we look for a key in the Map?

Viewed 40809

Possible Duplicate:
Is there a good way to have a Map<String, ?> get and put ignoring case?

How to ignore case sensitive when searching a key in the java.util.Map?

I want to know whether we can look up for a key in the map by ignoring the case.

Example,
   Map<String, Integer> lookup = new HashMap<String, Integer>();   
   lookup.put("one", 1);   
   lookup.put("two", 2);   
   lookup.put("three", 3); 

The user input might be "ONE" or "one". in such a case instead of converting the user input to lowercase. is there is any way to ignore the key sensitive via any methods?

Thanks, Kathir

2 Answers
Related