LEN

Returns the length of a string.

Signature

    ┌─────────┐
IN ─┤   LEN   ├─ OUT
    └─────────┘
FUNCTION LEN : ANY_INT
  VAR_INPUT
    IN : ANY_STRING;
  END_VAR
END_FUNCTION

Returns INT. LEN accepts STRING.

Inputs

Name

Type

Description

IN

ANY_STRING

The string to measure.

Outputs

Name

Type

Description

Return value

INT

The number of characters in IN. Zero for an empty string.

Description

Returns the number of characters in IN. For an empty string, the result is 0.

Example

result := LEN('Hello');    (* result = 5 *)
result := LEN('');         (* result = 0 *)

See Also

  • LEFT — left substring

  • RIGHT — right substring

  • MID — middle substring

References