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 array range, starting from element with the Index index.
Sub Main;
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 Main;
After executing the example the StrL dynamic array is generated. The ArrayL1 array contains a copy of the StrL array except for the first and last 10 elements.
See also: