The collection.combine( ) method inserts col2 elements at the end or at the specified index position in the collection instance and returns the edited collection. Unlike the collection.insert( ) method, collection.combine( ) adds each value of col2 in the original collection, and not as a single collection element.
Note: This method modifies the original collection.
By default, col2 elements are added at the end of the orginal collection. You can pass in index the position where you want the col2 elements to be inserted in the collection. Warning: Keep in mind that collection elements are numbered from 0.
- If index > the length of the collection, the actual starting index will be set to the length of the collection.
- If index < 0, it is recalculated as index:=index+length (it is considered as the offset from the end of the collection).
- If the calculated value is negative, index is set to 0.