CONCAT

Concatenates two strings.

Signature

     ┌─────────┐
IN1 ─┤         │
     │ CONCAT  ├─ OUT
IN2 ─┤         │
     └─────────┘
FUNCTION CONCAT : ANY_STRING
  VAR_INPUT
    IN1 : ANY_STRING;
    IN2 : ANY_STRING;
  END_VAR
END_FUNCTION

The return type matches the input type. CONCAT accepts STRING. Both inputs must share the same type.

Inputs

Name

Type

Description

IN1

ANY_STRING

The first string.

IN2

ANY_STRING

The string to append to IN1.

Outputs

Name

Type

Description

Return value

ANY_STRING

IN1 followed by IN2. Same type as the inputs.

Description

Returns a new string formed by appending IN2 to the end of IN1.

Example

result := CONCAT('Hello', ' World');    (* result = 'Hello World' *)
result := CONCAT('A', 'B');             (* result = 'AB' *)

See Also

  • INSERT — string insertion

  • LEN — string length

  • LEFT — left substring

References