getIndexOf() is used to return an integer number which identifies the position of a specified sub-string:
String_var.GetIndexOf(substring, position)
The method needs two arguments:
|
substring |
specifies a quoted string or a variable containing the sub-string that will be searched for |
|
position |
is an integer value indicating the position in the buffer string at which the search should begin |
To start the search from the very beginning of the buffer string, specify the position argument as 1. This extract of a source code will return 5:
DEFINE pos INTEGER
CALL string_val.Append("a23456789b")
LET pos = string_val.GetIndexof("567",1)
DISPLAY "567 starts from the ", pos, " position"