CFLib.org – Common Function Library Project

isUpperLower(character)

Last updated November 20, 2005

author

Larry Juncker

Version: 1 | Requires: CF5 | Library: StrLib

Description:
This UDF will check to see if a submitted alpha character is Upper or Lower Case.

Return Values:
Returns either "upper", "lower", or "Not Alpha".

Example:

<cfoutput>
isUpperLower('U') = #isUpperLower('U')#<br>
isUpperLower('d') = #isUpperLower('d')#<br>
isUpperLower('F') = #isUpperLower('F')#<br>
</cfoutput>

Parameters:

Name Description Required
character The character to check. Yes

Full UDF Source:

/**
 * Checks to see if a submitted letter is Upper or Lower Case.
 * 
 * @param character 	 The character to check. (Required)
 * @return Returns either &quot;upper&quot;, &quot;lower&quot;, or &quot;Not Alpha&quot;. 
 * @author Larry Juncker (larry@aljnet.net) 
 * @version 1, November 20, 2005 
 */
function isUpperLower(character) {
	if(asc(character) gte 65 and asc(character) lte 90) return "upper";
	else if(asc(character) gte 97 and asc(character) lte 122) return "lower";
 	return "Not Alpha"; 
}
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