Description |
The element at the given (0 based) Index position is removed from the ArrayList.
The element Count is decremented by 1.
|
| Notes | An exception is thrown if the Index exceeds the Count value.
|
|
Microsoft MSDN Links |
System.Collections
System.Collections.ArrayList
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
uses
System.Collections;
var
List : System.Collections.ArrayList;
i : Integer;
begin
// Create our array list object
List := ArrayList.Create;
// Fill it with strings
List.Add('Hello');
List.Add('cruel');
List.Add('World');
// Display the contents : note the 0 indexing
for i := 0 to List.Count-1 do
Console.WriteLine(List.Item[i]);
// Remove an element
Console.WriteLine;
List.RemoveAt(1);
// Display the contents : note the 0 indexing
for i := 0 to List.Count-1 do
Console.WriteLine(List.Item[i]);
Console.Readline;
end.
| Show full unit code | Hello
cruel
World
Hello
World
|
|
|
|