Description

Gets a specified number of characters from a string, beginning at the right.Returns the specified number of characters from the end (or right side) of the specified string.

Returns

  • If the length of the string is greater than or equal to count, the rightmost count characters of the string
  • If count is greater than the length of the string, the whole string
  • If count is greater than 1, and the string is empty, an empty string

Category

String functions

Function syntax

Right(string, count)

See also

LeftMidReverse

Parameters

Parameter

Description

string

A string or a variable that contains one.

count

A positive integer that specifies the maximum number of characters to return.

Example

<cfscript>
    string="The quick brown fox jumps over the lazy dog"
    count=8
    writeOutput(Right(string,count)) // lazy dog
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy