I'll just go straight to the point. I want to move elements in an array in a uniform difference, let's say I have this.
string[] fruits = { "Banana", "Apple", "Watermelon", "Pear", "Mango" };
For example, let's say I want to remove "Apple", so I will do it.
fruits[1] = "";
Now all that remains is:
{ "Banana", "", "Watermelon", "Pear", "Mango" }
How can I remove part of Apple and get only:
{ "Banana", "Watermelon", "Pear", "Mango" }
Please note that the index of all elements from "Watermelon" to the end of the array moves 1 back. Any ideas?
source share