listItem function

Syntax

  • string listItem(stringList, index)

Parameters

  1. stringListstring
  2. indexfloat

Returns

Returns item at the given index.

Description

The listItem function returns the item of the stringList at the given index.

Note:

  • Indices are 0 - based.
  • Stringlists are a series of strings stored inside one string. The elements are separated by a semicolon (";"). Each item must be followed by a semicolon, also the last one! The data type is "string", thus it is not an array as used in other scripting languages.

Related

Examples

example.1
	listItem("rule;your;city;",2)
	# result = "city"

example.2
	listItem("texture_1.jpg;texture_2.jpg;texture_3.jpg;",0)
	# result = "texture_1.jpg"

In this topic