Attention

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

MID

Returns a substring from the middle of a string.

IEC 61131-3

Section 2.5.1.5.7

Support

Not yet supported

Signatures

#

Input (IN)

Input (L)

Input (P)

Return Type

Support

1

STRING

INT

INT

STRING

Not yet supported

2

WSTRING

INT

INT

WSTRING

Not yet supported

Description

MID(IN, L, P) returns L characters from IN starting at position P. Positions are 1-based: the first character is at position 1.

Example

result := MID('Hello World', 5, 1);   (* result = 'Hello' *)
result := MID('Hello World', 5, 7);   (* result = 'World' *)

See Also

  • LEFT — left substring

  • RIGHT — right substring

  • LEN — string length