# RIGHT

Updated: 11/30/2021, 7:00:45 PM
Created: 11/30/2021, 7:00:45 PM
Last Updated By: Jake Tuttle
Read Time: 1 minute(s)

# Description

The RIGHT function returns a sub-string composed of the last n characters of a specified string. It takes the general form:

RIGHT(expression, length)
1

Where:

expression evaluates to the string from, which the sub string is extracted.

length is the number of characters that are extracted. If length is less than 1, RIGHT returns null.

The RIGHT function is equivalent to sub-string extraction for the last n characters, i.e. expression[n] .

An example of use is as:

STR_VAL =" Today's Brush is Tomorrows Forest.- Bemba Proverb"
CRT LEFT(STR_VAL, 14)
CRT DQUOTE(LEFT(STR_VAL,999))
CRT DQUOTE(LEFT(STR_VAL,0))
1
2
3
4

to display:

Today's Brush
" Today's Brush is Tomorrows Forest.- Bemba Proverb"
""
1
2
3

See also: LEFT

Go back to jBASE BASIC

Go back to Programmers' Reference Guide