&&index

From m204wiki
Revision as of 15:33, 19 August 2022 by Ekern (talk | contribs) (Created page with "__TOC__ {| |width="50%"| '''Action:''' |width="50%"| Returns the 1-based position of the ''needle'' argument within the ''haystack'' argument, or it returns 0 if the ''needle...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Action:

Returns the 1-based position of the needle argument within the haystack argument, or it returns 0 if the needle value is not found within the haystack value.

If fewer than two arguments are specified, an error is issued.

Syntax:

&&index(haystack,needle

where the haystack and needle arguments observe the rules for &&function string arguments.

For example, the first &&index call in the following fragment would return 3; the second would return 0:

set &g = 'george'  &&index(&g,'or')  &&index('moe', 'x') 

Introduced: Build 58