RIGHT¶
Provided by standard.lib.
Right returns the right, initial string for a given string.
RIGHT (STR, SIZE) means: Take the first SIZE character from the right in the string STR.
Input STR is of type STRING, SIZE is of type INT, the return value of the function is of type STRING.
Example in IL
LD ‘SUSI’
RIGHT 3
ST VarSTRING1 (* Result is ‘USI’ *)
Example in FBD
Example in ST
VarSTRING1 := RIGHT (‘SUSI’,3);
Note
String functions are not “thread safe”: When using tasks, string functions may only be used in a single task. If the same function is used in different tasks, there is a danger of overwriting.