CFLib.org – Common Function Library Project

StripLZero(Num)

Last updated September 13, 2001

author

Critter Gewlas

Version: 1 | Requires: CF5 | Library: StrLib

Description:
Strips leading zero's from a string or number.

Return Values:
Returns a string.

Example:

<cfoutput>
#stripLZero(0006325)#<br/>
#stripLZero("0631 Appleton Lane")#
</cfoutput>

Parameters:

Name Description Required
Num Number or string to be modified. Yes

Full UDF Source:

/**
 * Strips leading zero's from a string or number.
 * 
 * @param Num      Number or string to be modified. 
 * @return Returns a string. 
 * @author Critter Gewlas (critter@cfresume.org) 
 * @version 1, September 13, 2001 
 */
function StripLZero(s) {
    return REReplace(s,"^0","","ALL");
}

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

Created by Raymond Camden / Design by Justin Johnson