Wednesday, November 28, 2012
Capitalize first letter in every words
ReReplace(str,"\b(\w)","\u\1","ALL")This is a case sensitive replacement. To alter this simply use "ReReplaceNoCase" instead of ReReplace.
or else if you want to customize you can make it as function
<cffunction name="CapFirst" access="public" output="false" returntype="String"> <cfargument name="inputString" required="false" type="String" default="" /> <cfreturn rereplace(lcase(arguments.inputString), "(\b\w)", "\u\1", "all") /> </cffunction>Gud luck!
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment