Developers who use the C language and who are converting to JavaScript may be used to having support for testing various properties of character codes.
These functions are not formally part of the JavaScript language, although some of them are provided as part of the host environment through additional objects that provide C-like functionality. These are modelled on the Math object and cannot usually be instantiated by belonging to the Global object in the same way as the Math object does.
ScriptEase by Nombas is one such interpreter that provides support for C language functionality through its Clib object.
If you are using other interpreters, you can simulate these character handling functions with fragments of script and some bitwise operators.
The following functions that are normally available to C programmers are simulated with these script examples:
isalnum()
isalpha()
iscntrl()
isdigit()
isgraph()
islower()
isprint()
ispunct()
isspace()
isupper()
isxdigit()
Prev | Home | Next |
Character entity | Up | Character set |
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. |