Right

Extracts a number of characters from a given string, beginning with the last character on the right.

Syntax

Right(s, n )

Parameters

Parameter

Description

s

The string to extract.

n

The number of characters to extract.

If n is greater than the length of the string, the function returns the whole string.

If n is 0 or less, the function returns an empty string.

Examples

The following expressions are examples that use the Right function:

Expression

Returns

Right("ABCDEFGH", 3)

FGH

Right("Tony Blue", 5)

" Blue"

Right(Telephone[0], 7)

The last seven characters of the first occurrence of Telephone.

Right(Rtrim(CreditCard_Num), 4)

The last four characters of CreditCard_Num.

See also Rtrim.

// Ethnio survey code removed