+ 1
I need to know how to delete array element
plz send me a code for example of this question
7 Réponses
+ 4
To remove by value:
book remove = false;
for(int i=0; i < array.length-1; i++){
if(remove){
array[i] = array[i+1];
continue;
}
if(array[i] == value){
remove = true;
array[i] = array[i+1];
}
}
+ 4
Do you want to do it by index or value?
+ 3
Do you want to do it by index or value?
+ 3
But basically for index (array is the array):
int remove = 10;
for(int i=remove; i < array.length-1; i++){
array[i] = array [i+1];
}
+ 1
both
+ 1
i want know how to remove array element in array ?
+ 1
thanks a lot. i will try