Right
Extract the rightmost count characters from a string
Method Signature
Arguments
Argument
Type
Required
Description
Default
string
string
true
The string to extract from
count
integer
true
The number of characters to retrieve.
Examples
Using right() on a string
In this example we'll use right() to return part of a string.
Result: lazy dog
Using right() with a negative count on a string
In this example we'll use a negative count right() to return part of a string. CF2018+
Result: the lazy dog
Using right() in a function
In this example we'll use right() in a function to help us to capitalize the last letter in a string.
Using right() to test values
In this example we'll use right() to test the last five characters of a request context variable.
Using right() as a member function
In this example we'll use right() as a member function inside a function to help us to capitalize the last letter in a string.
Additional Examples
Related
Last updated
Was this helpful?