March Docs

Char

Char module: character classification and conversion utilities.

Wraps the built-in char_* primitives for idiomatic use. All predicates return Bool; conversions preserve the char type.

Functions

fnis_alphais_alpha(c : Char) : Bool#

Returns true if c is an ASCII letter (a-z or A-Z).

fnis_digitis_digit(c : Char) : Bool#

Returns true if c is an ASCII digit (0-9).

fnis_alphanumericis_alphanumeric(c : Char) : Bool#

Returns true if c is an ASCII letter or digit.

fnis_upperis_upper(c : Char) : Bool#

Returns true if c is an ASCII uppercase letter (A-Z).

fnis_loweris_lower(c : Char) : Bool#

Returns true if c is an ASCII lowercase letter (a-z).

fnis_whitespaceis_whitespace(c : Char) : Bool#

Returns true if c is an ASCII whitespace character (space, tab, newline, etc.).

fnto_upperto_upper(c : Char) : Char#

Converts c to uppercase. Non-alphabetic chars are returned unchanged.

fnto_lowerto_lower(c : Char) : Char#

Converts c to lowercase. Non-alphabetic chars are returned unchanged.

fnto_intto_int(c : Char) : Int#

Returns the integer code point of c.

fnfrom_intfrom_int(n : Int) : Char#

Returns the character with the given code point.

fnto_stringto_string(c : Char) : String#

Returns a single-character string containing c.

fnis_asciiis_ascii(c : Char) : Bool#

Returns true if c is ASCII (code point 0-127).

fnis_printableis_printable(c : Char) : Bool#

Returns true if c is a printable ASCII character (code point 32-126).

fndigit_valuedigit_value(c : Char) : Int#

Returns the numeric value of a digit character (0-9). Panics if not a digit.

fnhex_digit_valuehex_digit_value(c : Char) : Int#

Returns the hex value of a hex digit (0-9, a-f, A-F). Panics if not hex.

fnis_hex_digitis_hex_digit(c : Char) : Bool#

Returns true if c is a hex digit (0-9, a-f, A-F).