RIGHT

The RIGHT function returns a specified number of characters from the right-hand side of a string.

The RIGHT function is often used to manipulate string inputs and outputs, for example, to show shortened string values on Mimics.

Function Name

RIGHT

Description

Returns a specified number of characters from the right-hand side of an input string.

Arguments

RIGHT('STRING', LENGTH)

Where:

  • String is the string expression in which to search. The string must be enclosed within single quotations. For more information, see String
  • Length is a numerical expression (REAL or INTEGER) that indicates the number of characters to be returned. If the LENGTH is 0, no characters are returned. If the LENGTH is equal to or greater than the total number of characters in the string, the entire string is returned.
Returns

STRING.

The returned value is a string value that consists of the specified number of characters. The characters are taken from the defined input string, beginning at the last character and moving backwards toward the left of the string.

Example:

RIGHT( 'Pipeline', 4 )

The output is 'line'.


Disclaimer

ClearSCADA 2017 R3