std/unicode
Character classification and case conversion for ASCII/UTF-8 bytes.
from "std/unicode" import { isAlpha, isDigit, isWhitespace, toLowerChar, toUpperChar, isNumeric }Functions
isAscii
fn isAscii(c: u8): boolReturns true if c is in the ASCII range (0-127).
isDigit
fn isDigit(c: u8): boolReturns true if c is an ASCII digit (0-9).
isLower
fn isLower(c: u8): boolReturns true if c is a lowercase ASCII letter.
isUpper
fn isUpper(c: u8): boolReturns true if c is an uppercase ASCII letter.
isAlpha
fn isAlpha(c: u8): boolReturns true if c is an ASCII letter (a-z, A-Z).
isAlphanumeric
fn isAlphanumeric(c: u8): boolReturns true if c is an ASCII letter or digit.
isWhitespace
fn isWhitespace(c: u8): boolReturns true if c is an ASCII whitespace character (space, tab, newline, etc.).
isPunctuation
fn isPunctuation(c: u8): boolReturns true if c is an ASCII punctuation character.
isHexDigit
fn isHexDigit(c: u8): boolReturns true if c is a hexadecimal digit (0-9, a-f, A-F).
isPrintable
fn isPrintable(c: u8): boolReturns true if c is a printable ASCII character (0x20-0x7E).
isControl
fn isControl(c: u8): boolReturns true if c is an ASCII control character (0x00-0x1F, 0x7F).
toLowerChar
fn toLowerChar(c: u8): u8Converts an uppercase ASCII letter to lowercase. Non-letters pass through unchanged.
toUpperChar
fn toUpperChar(c: u8): u8Converts a lowercase ASCII letter to uppercase. Non-letters pass through unchanged.
isNumeric
fn isNumeric(s: &string): boolReturns true if every byte in the string is an ASCII digit.
isAlphaStr
fn isAlphaStr(s: &string): boolReturns true if every byte in the string is an ASCII letter.