Answers for "from bytes to string rust"

1

rust string from bytes

String::from_utf8_lossy(&[u8]) -> Cow<'_, str>

Basically

let x: &str = &String::from_utf8_lossy(&[1, 7, 4, 32, 69]);
Posted by: Guest on September-07-2021

Browse Popular Code Answers by Language