StrArray add/remove/insert elements |
![]() |
|
|
|
|
|
Add will append the passed element at the end of the array. The array size will be increased by one. The returned value is the 0-based index of the newly added element (i.e. the new value of the array upper limit)
Invoking Add achieves the same effect as SetAtGrow (GetUpperLimit(), elem)
|
|
|
|
|
Append will append all elements from the passed source string array to the called StrArray object. The returned value is the 0-based index of the first appended element.
|
|
|
|
|
InsertAt will insert the specified string at the given array index, shifting all existing elements and increasing the array size. If a value other than 1 is specified as the insert count, that number of elements will be inserted (and they all will contain a copy of the specified source string).
The passed 0-based index must be less than or equal to the upper limit of the array.
|
|
|
|
|
This overload of InsertAt will insert a copy of all the elements of the passed newArray at the 0-based index. The index must be less than or equal to the upper limit of the array.
After the operation, the size of the destination array will increase by newArray.GetSize()
|
|
|
|
|
RemoveAt will delete the specified number of elements (1 by default) at the given 0-based index in the array. The number of elements to be deleted cannot be greater than the number of elements available at the source index.
All remaining elements will be shifted "downwards" and the array size will be decreased by nCount.
See also: StrArray class