Removes a range of items from a collection starting at Index.
&VarCollection1.RemoveRange(Numeric Index[, Numeric Count])
Where:
&VarCollection1
The collection from which a range of elements will be removed.
Numeric Index
Indicates the Numeric Index where the removal of elements will start.
Numeric Count
This is an optional parameter that indicates how many items must be removed from the collection to which the method was applied, starting from the Numeric Index. If not specified, all items will be removed starting from the Numeric Index.
Type Returned:
Boolean
Generator: .NET .NET Framework, Java, Android
1)
//&NumericCollection1 = (1, 2, 3, 4, 5, 6)
&NumericCollection2 = &NumericCollection1.RemoveRange(3)
The result is:
&isOK= true
&NumericCollection1 = (1, 2)
2)
//&NumericCollection1 = [1, 2, 3, 4, 5, 6]
&NumericCollection2 = &NumericCollection1.RemoveRange(3, 2)
The result is:
&isOK = true
&NumericCollection1 = (1, 2, 5, 6)
This method is available since GeneXus 18 Upgrade 9.
AddRange method
Set method in Collections