Module std::char
Character manipulation (char
type, Unicode Scalar Value)
This module provides the Char
trait, as well as its implementation
for the primitive char
type, in order to allow basic character manipulation.
A char
actually represents a
Unicode Scalar Value,
as it can contain any Unicode code point except high-surrogate and
low-surrogate code points.
As such, only values in the ranges [0x0,0xD7FF] and [0xE000,0x10FFFF]
(inclusive) are allowed. A char
can always be safely cast to a u32
;
however the converse is not always true due to the above range limits
and, as such, should be performed via the from_u32
function..
Statics
pub static MAX: char = '\U0010ffff' |
The highest valid code point |
Traits
Char | Useful functions for Unicode characters. |
Functions
decompose_canonical | Returns the canonical decomposition of a character |
decompose_compatible | Returns the compatibility decomposition of a character |
escape_default | Returns a 'default' ASCII and C++11-like literal escape of a |
escape_unicode | Returns the hexadecimal Unicode escape of a |
from_digit | Converts a number to the character representing it |
from_u32 | Converts from |
is_XID_continue | Returns whether the specified |
is_XID_start | Returns whether the specified |
is_alphabetic | Returns whether the specified |
is_alphanumeric | Indicates whether a |
is_control | Indicates whether a |
is_digit | Indicates whether the |
is_digit_radix | Checks if a |
is_lowercase | Indicates whether a |
is_uppercase | Indicates whether a |
is_whitespace | Indicates whether a |
len_utf8_bytes | Returns the amount of bytes this |
to_digit | Converts a |
to_lowercase | Convert a char to its lowercase equivalent |
to_uppercase | Convert a char to its uppercase equivalent |