Developer Documentation Library > UNICOM Intelligence Function Library > Text, categorical, and array functions > Right
 
Right
Returns a string containing the last characters from a string, a category list containing the last categories from a category list, or an array containing the last elements from an array.
Syntax
Right(<value>, <length>)
Parameters
<value>
Type: Type: None
Text value, categorical value, or array to operate on.
<length>
Type: Type: Long
Number of characters, categories, or elements to return. If <length> is greater than the number of items available, all of the items are returned.
(return)
Type: Type: None
The required characters, categories, or elements from <value>.
Notes
For type Text, the return value is of type Text, and contains <length> characters from the end of <value>. For type Categorical, the return value is of type Categorical, and contains <length> categories from the end of <value>. For an array (which can contain values of any type), the return value is an array, and contains <length> elements from the end of <value>. For any other type, an error occurs.
When <value> is NULL, the return value is NULL.
Examples
Function call
Val
Length
Result
Notes
Right(Val, Length)
24 St John's Road, Barnes
6
Barnes
The return value is the last six characters in the supplied string.
Right(Val, Length)
{4,2,9,15,6,7}
1
{7}
The return value is the last category in the supplied category list.
Right(Val, Length)
Split("The quick brown fox")
3
{quick,brown,fox}
The return value is the last three elements in the supplied array. For more information, see Split.
The following example returns the 10 rightmost characters stored in the address text variable:
address.Right(10)
The following example returns the last two categories in the list of categories stored in the remember multiple response variable:
remember.Right(2)
See also
Find
Text, categorical, and array functions