CFLib.org – Common Function Library Project

IsAlphabet(str)

Last updated June 21, 2002

author

Takaki Saito

Version: 1 | Requires: CF5 | Library: StrLib

Description:
This UDF confirms that a string only contains letters, spaces, and periods.

Return Values:
Returns a boolean.

Example:

<CFSET strA = "abcde">
<CFSET strB = "abc de">
<CFSET strC = "abc.de">
<CFSET strD = "abc*de">
<CFSET strE = "abc1de">
<CFOUTPUT>
#strA# --- #IsAlphabet(strA)#<BR>
#strB# --- #IsAlphabet(strB)#<BR>
#strC# --- #IsAlphabet(strC)#<BR>
#strD# --- #IsAlphabet(strD)#<BR>
#strE# --- #IsAlphabet(strE)#<BR>
</CFOUTPUT>

Parameters:

Name Description Required
str String to check. Yes

Full UDF Source:

/**
 * This UDF confirms whether a string contains only letters.
 * 
 * @param str 	 String to check. (Required)
 * @return Returns a boolean. 
 * @author Takaki Saito (saito@softai.co.jp) 
 * @version 1, June 21, 2002 
 */
function IsAlphabet(str) {
    return not reFindNoCase("[^a-z\.[:space:]]",str);
}
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