Skip to content

list

Holds the "list" datatype

Associated DataTypes

list

A sequence of items in which it is possible to remove items from the ends or from arbitrary positions by index. The 'front' of the list is called the Head and the 'rear' the Tail. Items in the list may be indexed by ordinal position, with zero indicating the first item.

Members

int Count

Number of items in the list.

bool Clear

Removes all elements from the list. Always returns true.

bool Contains[string]

True if at least one instance of string is contained in the list and false otherwise.

list Splice

Returns a copy of the original list.

list Splice[int]

Returns a copy of the original list from the indicated position to the end of the list.

list Splice[int, int]

Returns a copy of the original list from the position specified by the first argument for an indicated number of elements.

int Index[string]

Returns the ordinal position of String in the List or -1 if String can not be found.

string Item[int]

Returns the string at the indicated position in the list.

bool Insert[int,sequence]

Insert a sequence of comma delimited strings into the source list before the ordinal indicated by Integer. True is returned if the sequence could be inserted and false otherwise.

bool Sort

Lexicographically orders the items. The source list is modified in place.

bool Reverse

Reorder the list in such a way that the 0'th item is swapped with the Count -1th item, the item with ordinal 1 with the Count -2th item, etc.

bool Append[sequence]

Insert a sequence of comma delimited strings onto the tail of the list.

int Remove[string]

Remove string from the input list. Return a count of how many times the item was removed.

bool Erase[int]

Remove an item from the input list by position. Return true if the item was removed or false if not.

int Replace[string,string]

Replaces the first string with the second string in the input list. A count of the number of times the replacement was performed is returned.

listiterator First

A listlterator is returned on the list where the current element under the iterator is the Head of the list if the list has elements or an empty iterator if the list is empty.

listiterator Find[string]

A listiterator is returned on the list where the current element under the iterator is the first item with a value equal to string if string is in the list and an empty iterator if it is not.
Remove and return the current item described at position 0 in the list. False is returned if the list is empty.

string Tail

Remove and return the current item described by position Count -1 in the list. False is returned if the list is empty.

int CountOf[string]

Return a count of the number of times string occurs in the list.

string Delimiter[string]

Sets the delimiter used to separate items in Insert and Append method calls. The previous delimiter is returned.

This TLO is added by MQ2Collections.