Attention

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

LEFT

Returns the leftmost characters of a string.

IEC 61131-3

Section 2.5.1.5.7

Support

Not yet supported

Signatures

#

Input (IN)

Input (L)

Return Type

Support

1

STRING

INT

STRING

Not yet supported

2

WSTRING

INT

WSTRING

Not yet supported

Description

Returns the leftmost L characters of IN. If L is greater than or equal to the length of IN, the entire string is returned.

Example

result := LEFT('Hello', 3);    (* result = 'Hel' *)
result := LEFT('Hi', 10);      (* result = 'Hi' *)

See Also

  • RIGHT — right substring

  • MID — middle substring

  • LEN — string length