String
CONCAT
The CONCAT function concatenates two or more strings into one.
result := CONCAT('Hello, ', 'World!'); // Result: 'Hello, World!'
LEN
The LEN function returns the length of a string.
length := LEN('Hello'); // Result: 5
FIND
The FIND function searches for a substring within a string and returns the position of the first occurrence.
position := FIND('World', 'Hello, World!'); // Result: 8
INSERT
The INSERT function inserts a substring into a string at a specified position.
result := INSERT('Hello, !', 'World', 7); // Result: 'Hello, World!'
DELETE
The DELETE function deletes a specified number of characters from a string starting at a given position.
result := DELETE('Hello, World!', 7, 6); // Result: 'Hello, !'
REPLACE
The REPLACE function replaces a substring within a string with another substring.
result := REPLACE('Hello, World!', 'World', 'IEC61131-3'); // Result: 'Hello, IEC61131-3!'
LEFT
The LEFT function returns the leftmost characters of a string.
result := LEFT('Hello, World!', 5); // Result: 'Hello'
RIGHT
The RIGHT function returns the rightmost characters of a string.
result := RIGHT('Hello, World!', 6); // Result: 'World!'
MID
The MID function returns a substring from a string, starting at a specified position.
result := MID('Hello, World!', 8, 5); // Result: 'World'