SiMX Help‎ > ‎The Target Platform‎ > ‎Objects‎ > ‎TARGET Object‎ > ‎target.strlib‎ > ‎


Platform Objects


In String, use InStr() to find a substring within a string.


target.strlib.InStr( input, look_for, length, s_pos )

look_for (input) - This is a regular expression
length integer (output) - The length of the sub-string found
s_pos integer (optional, in/out) - search from position (default is 0)

Return value

The starting position of the found sub-string


'---------- Start ----------
Function Start
Dim str, str2

str = "The Lot Number is 177592 "
str2 = target.strlib.InStr( str, "\d\d" )
trg.Message( str2 )
End Function

In this case InStr searches for something that matches the regular expression mask and gives us its starting position.

See also

TextConverter's "this" Object