Module CharExtras


module CharExtras: sig  end
Utility functions for dealing with characters



Locale


val set_chartype : string -> string option
Set the CTYPE locale.
val get_chartype : unit -> string
Query the CTYPE locale being used.


Character classification



The following functions test characters for certain properties. Wrappers for the C <ctype.h> header.

val is_alpha : char -> bool
Is the character alphabetic?
val is_space : char -> bool
Is the character whitespace?
val is_number : char -> bool
Is the character a digit?
val is_lower : char -> bool
Is the character lowercase?
val is_upper : char -> bool
Is the character uppercase?
val is_alphanumeric : char -> bool
Is the character alphabetic or a digit?
val is_punctation : char -> bool
Is the character a punctuation symbol?
val is_printable : char -> bool
Is the character displayable?
val is_graphical : char -> bool
Is the character displayable and not whitespace?
val is_hexadecimal : char -> bool
Is the character a digit in base 16?


Character transformation


val to_lower : char -> char
Lowercase the character according to the CTYPE locale.
val to_upper : char -> char
Uppercase the character according to the CTYPE locale.