- Home /
how can i check if there is a blanc spot in my list
how can i check if there is a blanc spot in my list and if it is the how can i remove it! and te size isnt al the time the same ][1]
Answer by tormentoarmagedoom · May 27, 2018 at 01:59 PM
Good day.
First, the Element[2] is "null", so you can chek:
if (array[2] == null)
But, you cna not delete the position. the array is stored as a 6 length element. If want to remove, you need to remake all the array.
Maybe, what you want to use is a List, not an array. It works almost the same as arrays, but you can add, remove & change positions of elements.
Go look for manual / API / UA pages to know how to use them.
Bye!
Answer by PanzerPotato · May 27, 2018 at 05:02 PM
Or, better yet:
void Check () {
for (int i = 0; i < array.length; i++) {
if (array [i] == null) {
//do anything you like
}
}
}
If you are using lists instead, just change "array.length" to "array.Count" (and "array" in this snippet being the variable that stores your array)