Position


 

Position>substring,string,start,result[,relative]

 

Returns the starting position of a substring in a string.  The search commences at the position specified in start.  If found the starting position of the substring is returned in the result variable.  If no match is found this value will be zero.

 

If string is an empty string (length zero) or start is greater than the length of the string then the result will be zero.

 

The optional parameter 'relative' can be used to determine whether the position returned is relative to the start position or an absolute position in the string being searched.  The default is TRUE (compatible with previous versions).  Set to FALSE to return the absolute position.

 

Abbreviation : Pos

See also: Length, MidStr, ConCat

 

Example

 

In this example, StartPos will contain the value 4 :

 

Position>Smith,Mr Smith,1,StartPos