Returns the right-most n characters of a string.
Informal Syntax:
Formal Syntax:
RIGHT( In:=expression, L:=expression )
Parameter | Type | Description |
---|---|---|
In | ANY_STRING | The input string. |
L | ANY_INT | The number of characters to return. |
The function is overloaded and accepts either the STRING or WSTRING type for the In parameter.
The return value is a string consisting of the right-most L characters of string In.
The type of the string returned is the same as the In parameter.
If L is greater than the length of the In parameter, the function returns the entire string. If L is zero or negative, the function returns a zero length string.
Example | Return Value |
---|---|
RIGHT('', 2) | STRING#'' |
RIGHT('Megabit', 3) | STRING#'bit' |
RIGHT(In:="Kilobit", L:=4) | WSTRING#"bit" |
IEC 61131-3 Second Edition: Table 29.3.
IEC 61131-3 Third Edition: Table 34.3.
Note: The function allows negative values for the L parameter. The IEC 61131-3 standard states this should be an error.
To learn about other String Functions.
To learn about other IEC 61131-3 Common Elements.
For the meaning of terms used in Fernhill SCADA.