Icon Pos

Unit: Internal

Available In: Client and Server Applications

function Pos(const SearchValue: String; const Value: String;
             Index: Integer=1): Integer

The Pos function returns the position of the SearchValue input parameter in the Value input parameter. The optional Index parameter specifies the starting index of the search and, if not specified, the search will start at the first character of the Value input parameter. The return value is an Integer value of 0 if the SearchValue input parameter was not found, or the index of the SearchValue if it was found.

Examples

X := Pos(' ', 'Whereisthe spaceinthisstring');  // X is 11
Image