listFind: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Macros:Functions:listFind moved to listFind) |
Verisimilar (talk | contribs) m (Added version.) |
||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=listFind | |name=listFind | ||
|version=1.3b42 | |||
|description= | |description= | ||
Returns the index of the first occurrence of a value in a [[Macros:string list|string list]]. If the value is not found then -1 is returned. | Returns the index of the first occurrence of a value in a [[Macros:string list|string list]]. If the value is not found then -1 is returned. | ||
Line 6: | Line 7: | ||
|usage= | |usage= | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
listFind(list, value) | |||
</source> | |||
<source lang="mtmacro" line> | |||
listFind(list, value, delim) | |||
</source> | </source> | ||
Revision as of 10:25, 10 March 2009
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")]