formatUKPostcode(str)
Last updated July 27, 2012
Version: 1 | Requires: CF5 | Library: StrLib
Description:
Formats a string to become a valid UK postcode
Return Values:
Returns a string
Example:
#formatUKPostcode(form.postcode)#
Parameters:
Name | Description | Required |
---|---|---|
str | String to format | Yes |
Full UDF Source:
/**
* Formats a string to become a valid UK postcode
* version 1.0 by Steve Chandler
*
* @param str String to format (Required)
* @return Returns a string
* @author Steve Chandler (cflib@chandler.it)
* @version 1, July 27, 2012
*/
function formatUKPostcode(str){
var strPostcode = ucase(trim(replaceNoCase(str,' ','','all')));
return left(strPostcode,len(strPostcode)-3) & ' ' & right(strPostcode,3);
}
Search CFLib.org
Latest Additions
Raymond Camden added
QueryDeleteRows
November 04, 2017
Leigh added
nullPad
May 11, 2016
Raymond Camden added
stripHTML
May 10, 2016
Kevin Cotton added
date2ExcelDate
May 05, 2016
Raymond Camden added
CapFirst
April 25, 2016