Official Content

Removes a range of items from a collection starting at Index.

Syntax

&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

Scope

Generator: .NET .NET FrameworkJavaAndroid

Samples

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)

Availability

This method is available since GeneXus 18 Upgrade 9.

See Also

AddRange method
Set method in Collections

 

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant