FIND

Provided by Standard Library.

Function of type INT, searches for the position of a partial string within a string.

Inputs:

STR1 : STRING, string within which STR2 should be searched

STR2 : STRING, string whose position should be searched in STR1

Return value: INT, start position of STR2 in STR1; “0” if STR2 is not found in STR1. The position of a character within a string is starting count by “1”.

FIND(STR1, STR2) means: Find the position of the first character where STR2 appears in STR1 for the first time. If STR2 is not found in STR1, then OUT:=0.

Example in IL: ( Result is ‘4’ )\ \ \ \

../_images/d5ed3d251e8f7b46c0a8640e01947982

Example in FBD:\ \ \ \

../_images/4b7345061e8f7a99c0a8640e01947982

Example in ST:\ \ \ \

arINT1 := FIND ('abcdef','de');