listIndex

Synopsis

float listIndex(string stringList, string item)

Returns

Returns index of first occurrence of item.

This function returns the index of the first occurrence of the item in the stringList or -1 if it is not found. Optional: leading or trailing * in item are used as wildcard.

Note.1: Indices are 0 - based.

Note: 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
    listIndex("rule;your;city;","city")
    # result = 2

example.2
    listIndex("rule;your;city;","*y")
    # result = 2

example.3
    listIndex("rule;your;city;","*y*")
    # result = 1   
	

Copyright ©2008-2016 Esri R&D Center Zurich. All rights reserved.