%lpos() Function

Top  Previous  Next

%lpos() function seeks a substring in the given string in right-to-left order and returns the start position of it. If substring is not found then "0" is returned.

Syntax:

%lpos(substringstring)

 

Examples:

%lpos('-','AAA-BBB-CCC')        %// result: 8

 

%set(v:var1,'xyz')

%lpos(v:var1,'xyz abc xyz abc') %// result: 9

 

%lpos('x','abcdefgh')           %// result: 0

 

 

See @pos()