CFLib.org – Common Function Library Project

isUpperLower(character)

Last updated November 21, 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"; 
}

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