-
Rust연습_문자열을 숫자로 변환해야 하고 .parse() 메서드를 사용코딩Coding/Rust연습 2021. 5. 8. 19:15728x90
문자열을 숫자로 변환해야 하고 .parse() 메서드를 사용
Suppose we write a program to convert a string into a number with a .parse() method:
fn main() { let number: u32 = "42".parse().expect("Not a number!"); println!("{}", number); }
결과
한글
docs.microsoft.com/ko-kr/learn/modules/rust-understand-common-concepts/3-data-types
영문
docs.microsoft.com/en-us/learn/modules/rust-understand-common-concepts/3-data-types
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust연습_추리 게임 튜토리얼 (0) 2021.05.09 Rust연습_Booleans-bool 형식 (0) 2021.05.08 Rust연습_문자 및 문자열출력Character and strings (0) 2021.05.08 Rust연습_ The default type is f64. On modern CPUs, the f64 type is roughly the same speed as the f32 type, but it has more precision. (0) 2021.05.08 Rust연습-Shadowing (0) 2021.05.08 Rust연습-Mutability_ In Rust, variable bindings are immutable by default. (0) 2021.05.08 Rust연습_데이터 형식 알아보기(u32, i32..) (0) 2021.05.08 Rust연습_변수 만들고 출력(Create and use variables) (0) 2021.05.08