CODESYS FIND

FIND is a CODESYS Standard library string function declared as FUNCTION FIND : INT. It searches for the first occurrence of substring STR2 in string STR1 and returns the character position. If STR2 is not found in STR1, it returns 0.

Source checked12/12 values · 2026-10-26

Specification

2 sources
Languagestructured text
CodeFIND
GroupString Functions
SyntaxFIND(STR1, STR2)
DialectCODESYS

Parameters

NameData typeDescription
FINDINTCharacter position of the first occurrence of STR2 in STR1; 0 if no occurrence is found.
STR1STRING(255)String within which STR2 is searched.
STR2STRING(255)String whose position is searched in STR1.

Study notes

  • Example in ST: arINT1 := FIND('abcdef','de'); returns 4.
↑↓ navigate↵ openesc close