Character Library

The character library provides functionality for classifying and transforming individual characters. These functions are accessible as methods of character values.

Changes from MiniD 1

The isValid function has been added.

Methods

These are all called as "c.methodname()", where "c" is any character value.

c.toLower()

If c is an uppercase letter, returns the lowercase version of the letter. Otherwise, just returns the character itself.

c.toUpper()

If c is a lowercase letter, returns the uppercase version of the letter. Otherwise, just returns the character itself.

c.isAlpha()

Returns true if c is an alphabetic character; false otherwise.

c.isAlNum()

Returns true if c is an alphanumeric character; false otherwise.

c.isLower()

Returns true if c is a lowercase alphabetic character; false otherwise.

c.isUpper()

Returns true if c is an uppercase alphabetic character; false otherwise.

c.isDigit()

Returns true if c is a decimal digit (0 - 9); false otherwise.

c.isCtrl()

Returns true if c is a control character (characters 0x0 to 0x1f and character 0x7f); false otherwise.

c.isPunct()

Returns true if c is a punctuation character; false otherwise.

c.isSpace()

Returns true if c is a whitespace character; false otherwise.

c.isHexDigit()

Returns true if c is a hexadecimal digit (0 - 9, A - F, a - f); false otherwise.

c.isAscii()

Returns true if c is an ASCII character (<= 0x7f); false otherwise.

c.isValid()

Returns true if c is a valid Unicode character; false otherwise.