Whatever message this page gives is out now! Go check it out!

Reverse

Last update:
May 18, 2026

Description

Reverses the order of items, such as the characters in a string or the digits in a number.

Returns

A copy of string, with the characters in reverse order.

Category

Function syntax

Reverse(string)

See also

Parameters

Parameter
Description
string
A string or a variable that contains one

Usage

You can call this function on a number with code such as the following:
<cfoutput>reverse(6*2) equals #reverse(6*2)#<cfoutput>
This code outputs the following:
reverse(6*2) equals 21
Example
<cfscript>
    stringToReverse="The quick brown fox jumps over the lazy dog"
    writeOutput(Reverse(stringToReverse))
</cfscript>
Output
god yzal eht revo spmuj xof nworb kciuq ehT

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page