I'm writing a script that creates a map from user nicknames to user IDs:
// Get client informations to map
for (Client c : api.getClients()) {
teamspeakUserInfos.put(c.getNickname(), c.getId());
}
Example mapping:
Nickname | 5
Username | 2
John |12
Here is my code for checking key presence in the map:
if (teamspeakUserInfos.containsKey(genUserNickname())) {
victimTeamspeakID = teamspeakUserInfos.get(genUserNickname());
break;
}
genUserNickname()
can return upper-, lower- or mixed-case nickname.
My question now is, how can I check if this nickname is used as a key - while ignoring case differences?
Thank you in advance!