pub fn from_u32(i: u32) -> Option<char>
Converts a u32
to a char
.
Note that all char
s are valid u32
s, and can be cast to one with as
:
However, the reverse is not true: not all valid u32
s are valid char
s. from_u32()
will return None
if the input is not a valid value for a char
.
For an unsafe version of this function which ignores these checks, see from_u32_unchecked
.
Basic usage:
Returning None
when the input is not a valid char
:
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/char/fn.from_u32.html