GetRange(Index: Integer; Count: Integer): IStringList;
Index. Element index, starting from which the range should be obtained.
Count. The number of array elements in the range that should be obtained.
The GetRange method returns the array range according to the specified parameters.
Sub UserProc;
Var
StrL, StrL1: IStringList;
i: Integer;
Begin
StrL := New StringList.Create;
StrL1 := New StringList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrL.Add("Number " + Math.RandBetweenI(0, 100).ToString);
End For;
StrL1 := StrL.GetRange(10, StrL.Count - 20)
End Sub UserProc;
After executing the example the StrL dynamic array is generated. The StrL1 array contains a copy of the StrL array except for the first and last 10 elements.
See also: