FINDPermalink

Provided by standard library.

FIND searches for a partial string within a string.

The input variable STR1 and STR2 are type STRING, the return value of the function is type STRING.

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 Function Block Diagram

find

Example in Structured Text

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

String functions are not "thread safe": When using tasks, string functions may only be used in a single task. If the same function is used in different tasks, there is a danger of overwriting.