Library

std/char

ASCII character classification.

1 file lib/std/char/char.vader 4 exports

fn(char) -> bool classification predicates, split out of std/string so the codepoint-string API (std/string) and char classification (here) have distinct homes. Import-required, not part of the std/core prelude. Numeric- base predicates (is_hex_digit, is_digit_in_base) stay in std/numbers.

Functions

is_white_char :: fn(c: char) -> bool

True for ASCII whitespace: space, tab, newline, carriage return.

Parameters

cchar the codepoint to test.

Returns

bool
is_digit :: fn(c: char) -> bool

True for an ASCII decimal digit '0'–'9'.

Parameters

cchar the codepoint to test.

Returns

bool
is_alpha :: fn(c: char) -> bool

True for an ASCII letter 'a'–'z' or 'A'–'Z'.

Parameters

cchar the codepoint to test.

Returns

bool
is_alnum :: fn(c: char) -> bool

True for an ASCII letter or digit (is_alpha or is_digit).

Parameters

cchar the codepoint to test.

Returns

bool
Written by vader doc. Icons: Codicons, CC BY 4.0. Fonts: Atkinson Hyperlegible, JetBrains Mono, OFL.