Class Reference stringList

The stringList class provides a list of strings. More...


stringList(stringList list)
void append(string item)
string at(int pos)
void clear()
bool contains(string item)
int indexOf(string search, int start=0)
void insert(int pos, string value)
string join(string separator)
void prepend(string value)
int removeAll(string item)
void removeAt(int pos)
int size()
void set(int pos, string item)
void sortList(int style=0)
void swap(int pos1, int pos2)

Detailed Description

The stringList class provides a list of string datatypes. The class methods are very similar to other list classes.

If the scripting language supports native an arrays of string, this classed is mapped to the native methods.

Member Function Documentation


A new empty stringList is created.

stringList::stringList(stringList list)

Creates a new list of strings with a copy of list.

void stringList::append(string item)

Insert item at the end of the list.

string stringList::at(int pos)

Returns: string at the postion pos

void stringList::clear()

Removes all items from the list.

bool stringList::contains(string item)

Returns: true ,if the stringList contains the string item. Otherwise false is returned.

int stringList::indexOf(string search, int start=0)

Returns: Returns the index position of the first occurrence of the string search in this list, searching forward from start position. Returns -1, if search is not found.

void stringList::insert(int pos, string value)

value is added at position pos. All items at a position afterwards will move one position.

string stringList::join(string separator)

Joins all the string list's strings into a single string with each element separated by the given separator (which can be an empty string). (introduced with release 20180614)

void stringList::prepend(string value)

added to new item a the beginning of the list. (introduced with release 20180614)

int stringList::removeAll(string item)

Removes all occurrences of item in the list and returns the number of entries removed.

void stringList::removeAt(int pos)

Position pos is removed from the list. The size of the list is reduced by 1.

int stringList::size()

Returns: number of string in the stringList.

void stringList::set(int pos, string item)

Sets the posth entry of the list to item. The first entry of the list starts with 0. It will have no effect, if the list did not have at least a size of pos items.

void stringList::sortList(int style=0)

The list ist sorted. style determine the order style:

Values: Alignment:
0 case insensitive
1 case sensitive
10 by integer value (e.g. 1, 4, 8, 12, 34, 765 )

(introduced with release 20201224)

void stringList::swap(int pos1, int pos2)

Swaps the value at ''pos1'' and ''pos2''.