ItemLocate

Returns the position of an item in a list.

Syntax:

ItemLocate (item, list, delimiter)

Parameters:

(s) item item to search for in list. (this is case sensitive)

(s) list a string containing a list of items.

(s) delimiter a character to act as a delimiter between items in the list.

Returns:

(i) position in list of item, or 0 if no match found.

 

This function finds the first occurrence of item in the specified list, and returns the position of the item (the first item in a list has a position of 1). If the item is not found, the function will return a 0.

A single item null list ("") is not a valid list.

Example:


list="apples pears oranges grapes"
index=ItemLocate("oranges", list, " ")
Message("The item is located at index #", index)
See Also:

ItemCount, ItemCountCsv, ItemExtract, ItemExtractCsv, ItemInsert, ItemLocateWild, ItemRemove, ItemReplace, ItemSort, Lists Explained