CFLib.org – Common Function Library Project

acronym(sTerms)

Last updated May 20, 2005
Download UDF

author

Jordan Clark                                      Jordan Clark

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:

<cfoutput>I love #acronym( "Hyper Text Markup Language" )#.</cfoutput>

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

Raymond Compton Raymond Compton added
structBlend
20 day(s) ago

Duncan Duncan added
IsZIPUK
20 day(s) ago

Todd Sharp Todd Sharp added
getTagContentAll
26 day(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Created by Raymond Camden / Design by Justin Johnson