How to make object of array move to another array index

How to make object of array move to another array index.
Lets say i have array[10]
If i remove array index 3 for example. How do i make all object 4 move to index 3, object 5 move to index 4 etc
And if index last removed, not objects are changing their indexes

Removing elements from arrays isn’t very performant because they need to be reallocated. Instead you can set the element to null instead of removing it. Or just use a List which are very easy to add and remove elements.

1 Like

Yes, how do i make it to null, but move objects to higher index

You’re constantly asking basic C# questions.

Your time would be better spent doing some courses on C#.

But like Zulo said, if you need to add/remove/reorder elements in a collection, use a List<T> instead.

2 Likes