Coding Global Background
Coding Global

Beginner at Java, why doesn't this work?

Archiviert 2 years ago
3 Nachrichten
1 Mitglieder
Erstellt 2 years ago
Aktualisiert 2 years ago
In Discord öffnen
B
충고렌
Script Kiddie!
public static void removeName(ArrayList<String> arr, String str) {
for(int i = 0; i<arr.size(); i++) {
try {
if(str.indexOf(arr.get(i).substring(0,arr.get(i).indexOf(" ")))>-1) {arr.remove(i);}
if(str.indexOf(arr.get(i).substring(arr.get(i).indexOf(" ")))>-1) {arr.remove(i);}
}
catch(Exception e) {}
}
}

Antworten (3)