Character handling (Advice)

Functions for testing character attributes.

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:

See also:isAlnum(), isAlpha(), isCtrl(), isDigit(), isGraph(), isLower(), isODigit(), isPrint(), isPunct(), isSpace(), isUpper(), isXDigit()