Logo

Programming-Idioms

History of Idiom 22 > diff from v67 to v68

Edit summary for version 68 by tormenta77:
New Rust implementation by user [tormenta77]

Version 67

2019-03-03, 16:05:47

Version 68

2019-07-05, 18:02:43

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration
Extra Keywords
int base conversion
Extra Keywords
int base conversion
Code
let num : i32 = line.trim().parse()
        .expect(msg: &str);