我正在尝试检查我的 hashmap 键集是否包含字符串 'buffSB.toString()'。但我想比较忽略大小写(大写或小写)。
static StringBuilder buffSB = new StringBuilder();
buffSB.append(alphabet);
Map<String, String> pref = new Datamatch().main(); // Getting the Hashmap from other class
if(pref.containsKey(buffSB.toString())) //This is where I need to ignore case while searching string in the map key set
{
String val = pref.get(buffSB.toString());
}
任何帮助将不胜感激!!!