ascii
The ascii module provides helper functions for working with the subset of
Unicode which is defined by the American Standard Code for Information
Interchange (ASCII).
Index
Functions
fn isalnum(rune) bool;
fn isalpha(rune) bool;
fn isblank(rune) bool;
fn iscntrl(rune) bool;
fn isdigit(rune) bool;
fn isgraph(rune) bool;
fn islower(rune) bool;
fn isprint(rune) bool;
fn ispunct(rune) bool;
fn isspace(rune) bool;
fn isupper(rune) bool;
fn isxdigit(rune) bool;
fn strcasecmp(str, str) int;
fn tolower(rune) rune;
fn toupper(rune) rune;
fn valid(rune) bool;
fn validstr(str) bool;
Functions
fn isalnum
fn isalnum(c: rune) bool;
Returns true if an ASCII character is alphanumeric.
fn isalpha
fn isalpha(c: rune) bool;
Returns true if an ASCII character is a letter.
fn isblank
fn isblank(c: rune) bool;
Returns true if a rune is a space or a tab.
fn iscntrl
fn iscntrl(c: rune) bool;
Returns true if an ASCII character is a control character.
fn isdigit
fn isdigit(c: rune) bool;
Returns true if an ASCII character is a digit.
fn isgraph
fn isgraph(c: rune) bool;
Returns true if an ASCII character is any printable character other than
space.
fn islower
fn islower(c: rune) bool;
Returns true if an ASCII character is lowercase.
fn isprint
fn isprint(c: rune) bool;
Returns true if an ASCII character is printable.
fn ispunct
fn ispunct(c: rune) bool;
Returns true if an ASCII character is punctuation.
fn isspace
fn isspace(c: rune) bool;
Returns true if an ASCII character is a white-space character -
one of '\f', '\n', '\r', '\t', '\v', ' '.
fn isupper
fn isupper(c: rune) bool;
Returns true if an ASCII character is uppercase.
fn isxdigit
fn isxdigit(c: rune) bool;
Returns true if an ASCII character is a hexadecimal digit.
fn strcasecmp
fn strcasecmp(a: str, b: str) int;
Compares two strings by their ASCII sort order, treating all capital letters
as their lowercase counterpart (i.e. a case-insensitive comparison is
performed). Zero is returned if the strings are equal, a negative value if a
is less than b, or a positive value if a is greater than b. Aborts if a
non-ASCII byte is encountered.
fn tolower
fn tolower(c: rune) rune;
Returns the lowercase form of an ASCII character, or the original character
if it was not an uppercase letter (or was not ASCII).
fn toupper
fn toupper(c: rune) rune;
Returns the uppercase form of an ASCII character, or the original character
if it was not a lowercase letter (or was not ASCII).
fn valid
fn valid(c: rune) bool;
Returns true if a rune is a valid ASCII character.
fn validstr
fn validstr(s: str) bool;
Returns true if all runes in a string are valid ASCII characters.