Where is the from_char () function for integer types?

Type char has from_digit() and from_u32() to get char from a digit or from u32 , but where are the inverse functions for integer types (all of them)?

i.e. I expected to see some functions uN :: from _ {char | digit} () and iN :: from _ {char | digit} () (where N is 8, 16, 32, 64 or size) for symmetry, but apparently they do not exist.

+5
source share
1 answer

Reverse:

  • to_digit for from_digit : c.to_digit(12)
  • a as u32 for from_u32 : c as u32

The latter is the one you need if you want to use Unicode code for char .

+10
source

All Articles