Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomjuggler/718e513d504706a1f07a14aa4e95efc4 to your computer and use it in GitHub Desktop.
Save tomjuggler/718e513d504706a1f07a14aa4e95efc4 to your computer and use it in GitHub Desktop.
remove item from processing array
// credit: user nbrooks, stack overflow answer
// https://stackoverflow.com/questions/35822629/using-traditional-for-loop-to-remove-certain-elements-within-a-string-array
public void removeFromArray(String[] Arr, int item){
for (int i = item; i < Arr.length - 1; i++) {
// Replace each value with the next value
Arr[i] = Arr[i+1];
println(Arr[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment