This is a function normally found in the C language. However, it is useful to script developers as well and may be available in some implementations as an extension to the ECMA standard functionality.
This function will return true for any character in the following set:
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
Strictly speaking, this function should be coded to be aware of locale specific issues. You may want to take the example simulation provided here and modify it to your own needs to support that. This is just a basic working example.
// Test for upper case letters (only good up to char 127) function isUpper(aChar) { myCharCode = aChar.charCodeAt(0); if((myCharCode > 64) && (myCharCode < 91)) { return true; } return false; }
Prev | Home | Next |
isSpace() | Up | isXDigit() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |