Created
June 6, 2017 09:51
-
-
Save tomjuggler/718e513d504706a1f07a14aa4e95efc4 to your computer and use it in GitHub Desktop.
remove item from processing array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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