ArrayList RemoveAt() method in C# – Programming Code Examples
C# C# Console Application

ArrayList RemoveAt() method in C#1 min read

.Net framework ArrayList RemoveAt() method allow us to remove the element at the specified index of the ArrayList. this arraylist RemoveAt() method exists in System.Collections namespace. the RemoveAt() method require to pass a parameter named ‘index’.

the ‘index’ parameter value type is System.Int32. this integer value represents the zero-based index of the element to remove from arraylist. the arraylist RemoveAt() method implements as IList.RemoveAt(Int32).




RemoveAt() method throw ArgumentOutOfRangeException, if the ‘index’ is less than zero or the ‘index’ is equal to or greater than Count. arraylist RemoveAt() method also throw NotSupportedException exception, if the arraylist is read-only or the arraylist has a fixed size.

the following console c# example code demonstrate us how can we remove an element at the specified index of the arraylist programmatically at run time in an console application.

C# Code:

 

Output:

 

Leave a Comment