acronym(sTerms)
Last updated May 20, 2005
Version: 1 | Requires: ColdFusion 5 | Library: StrLib
Description:
Takes a full string of words as input then converts it for proper display in the html <acronym> tag. That way you see the acronym but in most browsers you can put your mouse over the acronym to display it's full meaning. I often see acronyms used in Blogs.
Return Values:
Returns a string.
Example:
Parameters:
| Name | Description | Required |
|---|---|---|
| sTerms | String to modify. | Yes |
Full UDF Source:
<cfscript>
/**
* Pass in a set of words to only display it's acronym.
*
* @param sTerms String to modify. (Required)
* @return Returns a string.
* @author Jordan Clark (JordanClark@Telus.net)
* @version 1, May 20, 2005
*/
function acronym(sTerms) {
return '<acronym title="' & sTerms & '">' & trim( reReplaceNoCase( " " & sTerms & " ", "(\w)\w+\s", "\1", "all" ) ) & '</acronym>';
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
3 day(s) ago
Will Belden added
longTime
9 day(s) ago
James Sleeman added
quickSort
19 day(s) ago
Ben Forta added
GetHostAddress
22 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)