position
Function
position — find position of a substring
Synopsis
position(s: string, sub: string) -> int64
position(sub: string IN s:string) -> int64
Description
The position function returns the 1-based index where string sub
first
occurs in string s
. If sub
is not a sub-string of s
then 0 is returned.
Examples
yield position(s, sub)
{s:"foobar",sub:"bar"}
Loading...
echo '{s:"foobar",sub:"bar"}' \
| super -z -c 'yield position(s, sub)' -