H
hüteüberhüte
Gast
Java:
public static void putMap(Map<String, Object> map, String s) { // + value parameter
int idx = 0;
if (s.matches("^\\d+_\\d+$")) {
int indexOf_ = s.indexOf('_');
idx = Integer.parseInt(s.substring(indexOf_ + 1));
s = s.substring(0, indexOf_);
}
String sNew;
while (map.containsKey(sNew = s + "_" + ++idx));
map.put(sNew, null);
}
IDE sagt mir Leere Anweisung in Zeile 9!
Zuletzt bearbeitet von einem Moderator: