rust标准库里没有atoi
。要将字符串转为整数,可以用parse
:
fn main() {
let s = "23333";
let x: usize = s.parse().unwrap();
println!("{}", x);
}
23333
rust标准库里没有atoi
。要将字符串转为整数,可以用parse
:
23333
Except as otherwise noted, this blog is licensed under CC BY-SA 4.0 License.
©2021-
searchstar
|
pv
|
uv
Theme Tree
by Wu Jun
Powered by Hexo