MID

MID

PROGRAM MID_DEMO
   VAR
   STRING1,STRING2: STRING;
    INT1, INT2: INT;
  END_VAR
    STRING1:=MID(IN:=STRING2,L:=INT2,P:=INT1);
END_PROGRAM

The function returns part of the string. The string length is given by the input variable L, the output string starts at the position P of the input string.

InputType Description
IN ANY_STRINGInput string
L ANY_INT Output string length
P ANY_INT Position of the start of the output string within the input string
OutputType Description
ANY_STRINGOutput string


IN: HAMBURGER
L: 3
P:1
Output: HAM

  • © Energocentrum Plus, s.r.o. 2017 - 2024