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)
int removeAll(string item)
void removeAt(int pos)
int size()
void set(int pos, string item)
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.

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::swap(int pos1, int pos2)

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