How to remove spaces from the end of a string in ColdFusion

RTrim() - remove spaces from the end of a string

RTrim.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RTrim function example: how to remove spaces from the end of a string</title>
</head>

<body>
<h2 style="color:HotPink">RTrim Function Example</h2>

<cfset TestString="Test string for RTrim function ">
<cfoutput>
<b>
TestString: [#TestString#]
<br />
TestString(after remove end spaces): [#RTrim(TestString)#]
</b>
</cfoutput>

</body>
</html>





More ColdFusion examples