CFLib.org – Common Function Library Project

upperFirst(name)

Last updated March 17, 2010

author

Brian Meloche

Version: 0 | Requires: CF5 | Library: StrLib

Description:
Converts the first letter of a string to upper case, while keeping the rest of the string as is.

Return Values:
Returns a string.

Example:

<cfoutput>
#upperFirst("myFirst")#
</cfoutput>

Parameters:

Name Description Required
name String to capitalize the first letter of Yes

Full UDF Source:

<!---
 Upper cases the first letter of a string.
 Phil Arnold (philip.r.j.arnold@googlemail.com
 
 @param name 	 String to capitalize the first letter of (Required)
 @return Returns a string. 
 @author Brian Meloche (brianmeloche@gmail.com) 
 @version 0, March 17, 2010 
--->
<cffunction name="upperFirst" access="public" returntype="string" output="false" hint="I convert the first letter of a string to upper case, while leaving the rest of the string alone.">
		<cfargument name="name" type="string" required="true">
		<cfreturn uCase(left(arguments.name,1)) & right(arguments.name,len(arguments.name)-1)>
</cffunction>
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