User Guide
672 Chapter 3: ColdFusion Functions
RTrim
Description
Removes spaces from the end of a string.
Returns
A copy of string, after removing trailing spaces.
Category
String functions
Function syntax
RTrim(string)
See also
LTrim, Trim
Parameters
Example
<h3>RTrim Example</h3>
<cfif IsDefined("FORM.myText")>
<cfoutput>
<pre>
Your string:"#FORM.myText#"
Your string:"#RTrim(FORM.myText)#"
(right trimmed)
</pre>
</cfoutput>
</cfif>
<form action = "Rtrim.cfm" method="post">
<p>Enter some text. It will be modified by Rtrim to remove spaces from the
right.
<p><input type = "Text" name = "myText" value = "TEST ">
<p><input type = "Submit" name = "">
</form>
Parameter Description
string A string or a variable that contains one