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
Ryan Thompson-Jewell added
ListSplit
1 day(s) ago
Nathan Dintenfass added
RowsToColumns
1 day(s) ago
Barney Boisvert added
indentXml
1 day(s) ago
Barney Boisvert added
REReplaceCallbac...
1 day(s) ago
Top Rated
FolderSize
Rated 5.0, 7 time(s)
UniqueValueList
Rated 5.0, 5 time(s)
QuickSort
Rated 5.0, 3 time(s)
ListDeleteDuplic...
Rated 5.0, 3 time(s)