CFLib.org – Common Function Library Project

removeEndSpaces(str)

Last updated March 6, 2010

Version: 2 | Requires: ColdFusion 5 | Library: StrLib

 
Rated 2 time(s). Average Rating: 5.0

Description:
strips all graph characters (spaces, tabs, line breaks) off the end of a string.

Return Values:
Returns a string.

Example:

view plain print about
#removeEndSpaces("My text string. #chr(9)# #chr(9)# #chr(13)##chr(10)# #chr(13)##chr(10)#")#

Parameters:

Name Description Required
str String to parse. Yes

Full UDF Source:

view plain print about
<cfscript>
/**
 * strips all graph characters (spaces, tabs, line breaks) off the end of a string.
 * Version 2 by Raymond Camden
 * 
 * @param str      String to parse. (Required)
 * @return Returns a string. 
 * @author Nick Giovanni (ngiovanni@gmail.com) 
 * @version 2, March 6, 2010 
 */

function removeEndSpaces(str) {
    return reReplace(str,"\s*$","","all");
 }
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Tayo Akinmade Tayo Akinmade added
arrayTrim
11 day(s) ago

Will Belden Will Belden added
longTime
17 day(s) ago

James Sleeman James Sleeman added
quickSort
27 day(s) ago

Ben Forta Ben Forta added
GetHostAddress
30 day(s) ago

Top Rated

Darwan Leonardo Sitepu EksporSQLData
Rated 5.0, 16 time(s)

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 13 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson