CFLib.org – Common Function Library Project

StripAscii(string)

Last updated December 10, 2002

author

Rob Brooks-Bilson

Version: 2 | Requires: CF5 | Library: StrLib

Description:
Strips all ASCII character codes from str.

Return Values:
Returns a string.

Example:

<CFSET str="This&nbsp; is&##155; a test&trade;">
<CFOUTPUT>
Given str=#str#<BR>
Stripped: #StripAscii(str)#
</CFOUTPUT>

Parameters:

Name Description Required
string String to be modified. Yes

Full UDF Source:

/**
 * Removes ASCII character codes from the string.
 * 
 * @param string 	 String to be modified. (Required)
 * @return Returns a string. 
 * @author Rob Brooks-Bilson (rbils@amkor.com) 
 * @version 2, December 10, 2002 
 */
function StripAscii(str)
{
  return REReplace(str, "&(##[0-9]{1,3}|[[:alpha:]]*[[:alnum:]]+);", "", "ALL");
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson