Function std::u8::parse_bytesExperimental [-]  [+] [src]

pub fn parse_bytes(buf: &[u8], radix: uint) -> Option<u8>

Parse a byte slice as a number in the given base

Yields an Option because buf may or may not actually be parseable.

Examples

fn main() { let num = std::uint::parse_bytes([49,50,51,52,53,54,55,56,57], 10); assert!(num == Some(123456789)); }
let num = std::uint::parse_bytes([49,50,51,52,53,54,55,56,57], 10);
assert!(num == Some(123456789));