StripAnchors(str)
Last updated November 1, 2002
Version: 2 | Requires: ColdFusion 5 | Library: StrLib
Description:
A function that will strip out all anchors in text that has been passed as an argument to the function.
Return Values:
Returns a string.
Example:
This is some text with some <b>html</b> in it as
well as <a href="links.cfm">links with <b>formatting</b></a> in them.
</cfsavecontent>
<cfoutput>#stripAnchors(foo)#</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| str | String to strip anchors from. | Yes |
Full UDF Source:
<cfscript>
/**
* A function that will strip out all anchors in text that has been passed as an argument.
* Version 2 by Raymond Camden
*
* @param str String to strip anchors from. (Required)
* @return Returns a string.
* @author Brian Brown (vonbrownz@hotmail.com)
* @version 2, November 1, 2002
*/
function stripAnchors(str) {
var temp = reReplaceNoCase(str,"<[[:space:]]*a[[:space:]]+[^>]*>","","all");
return reReplaceNoCase(temp,"<[[:space:]]*/a[[:space:]]*>","","all");
}
</cfscript>
Search CFLib.org
Latest Additions
Shawn Porter added
DeMoronize
3 hour(s) ago
Chris Carey added
readPropertiesFi...
1 day(s) ago
Randy Johnson added
lastDayofWeek
3 day(s) ago
Frank Marion added
sitemapPing
7 day(s) ago
Top Rated
QuickSort
Rated 5.0, 3 time(s)
indentXml
Rated 5.0, 3 time(s)
queryColumnsToSt...
Rated 5.0, 3 time(s)
generateSsccAsn
Rated 5.0, 3 time(s)