POS

 ──POS(needle,haystack──┬─────────┬─)─────
                          └─,start──┘

POS returns the position of one string, needle, in another, haystack. (See also the LASTPOS function.) If the string needle is not found, 0 is returned. By default, the search starts at the first character of haystack (that is, the value of start is 1). You can override this by specifying start (which must be a positive whole number) as the point at which the search starts.

Here are some examples:

POS('day','Saturday')       ->    6
POS('x','abc def ghi')      ->    0
POS(' ','abc def ghi')      ->    4
POS(' ','abc def ghi',5)    ->    8


[Back: OVERLAY]
[Next: QUEUED]