Previous Topic: Mid - Return a Substring from a StringNext Topic: Str - Convert Numeric Expression to String


Right - Return a Substring with Rightmost n Characters

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The Right function returns a substring containing the rightmost n characters from the string str.

Function format:

Right(str as String, n as Integer) as String

str

Indicates the string from which the right substring is to be taken.

n

Specifies the number of characters of the substring.

The function returns a substring containing the rightmost n characters from the string str.

Example:

This example shows how the string operations work.

Dim text As String
Text="Unicenter TNG"

Print("Left(text,3) : " + Left(text,3))  'Uni
Print("Mid(text,4,6) : " + Mid(text,4,6)) 'center
Print("Right(text,3) : " + Right(text,3)) 'TNG
Print("Length    : " + Str(Len(text))) '13