CFLib.org – Common Function Library Project

WAPSafe(string)

Last updated April 24, 2002

author

Ben Forta

Version: 2 | Requires: CF5 | Library: StrLib

Description:
Returns a WAP safe string. All dollar signs ($) are escaped ($$). All ampersands (&) are escaped (&).

Return Values:
Returns a string.

Example:

<CFOUTPUT>
<CFSET STR = "Some random string that may have a $ or & in it.">
The WAPSafe version of<BR>
<FONT COLOR="green">#STR#</FONT><BR>
is:<BR>
<FONT COLOR="green">#WapSafe(STR)#</FONT>
</CFOUTPUT>

Parameters:

Name Description Required
string The string to format. Yes

Full UDF Source:

/**
 * Returns a WAP safe string.
 * Update by anthony petruzzi
 * 
 * @param string 	 The string to format. 
 * @return Returns a string. 
 * @author Ben Forta (ben@forta.com) 
 * @version 2, April 24, 2002 
 */
function WAPSafe(string) {
        string = Replace(string, "&", "&amp;", "ALL");
	return Replace(string, "$", "$$", "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