listFind: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page listFind to ListFind without leaving a redirect: Converting page title to first-letter uppercase)
m (Conversion script moved page ListFind to listFind: Converting page titles to lowercase)
(No difference)

Revision as of 22:57, 9 February 2023

listFind() Function

Introduced in version 1.3b42
Returns the index of the first occurrence of a value in a string list. If the value is not found then -1 is returned.

Usage

listFind(list, value)
listFind(list, value, delim)

If delim is not specified then the default value of ',' is used as the value separator in the string list

Examples

[r: listFind("This, is, a, test", "is")]

Returns 1

[r: listFind("This: is: a: test", "a", ":")]

Returns 2

[r: listFind("This, is, a, test", "not")]
Returns -1