코딩Coding/Rust연습
rust연습]u8_sting_stack저장하기bytes() / std::str
내인생PLUS
2022. 4. 18. 01:44
728x90
use std::str;
fn main() {
for b in "안녕 ".bytes() {
println!("{}", b);
}
let a = vec![236, 149, 136, 235, 133, 149, 32];
let a = str::from_utf8(&a).unwrap();
println!("{a}");
}
결과
236
149
136
235
133
149
32
안녕
https://doc.rust-lang.org/std/str/fn.from_utf8.html
반응형