Function Block STR_PAD

The function block STR_PAD extends a string using another string to a specific length.

Input STR

The input defines the string that is manipulated.

Input LEN

The input defines the length of the string at the output. If the length is shorter than or equal to the length of the string at the input STR, no extension is performed.

Input PAD_STR

Defines the string with which it is extended. If the required number of characters to be added cannot be evenly divided by the length of the input, the string is truncated.

Input TYPE

The input defines the direction in which the characters are inserted. If no value is defined or another one is present, the type is set to 0.

Type Meaning
0 It is inserted on the right side.
1 It is inserted on the left side.
2 It is inserted on both sides.

Output

Outputs the extended string.