Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

FIND

Searches for a substring within a string.

IEC 61131-3

Section 2.5.1.5.7

Support

Supported

Signatures

#

Input (IN1)

Input (IN2)

Return Type

Support

1

STRING

STRING

INT

Supported

2

WSTRING

WSTRING

INT

Not yet supported

Description

FIND(IN1, IN2) returns the position of the first occurrence of IN2 within IN1. Positions are 1-based. If IN2 is not found, the function returns 0.

Example

See Also

  • REPLACE — string replacement

  • MID — middle substring

  • LEN — string length