Logo

Programming-Idioms

History of Idiom 22 > diff from v10 to v11

Edit summary for version 11 by :

Version 10

2015-08-20, 15:23:26

Version 11

2015-08-20, 16:08:12

Idiom #22 Convert string to integer

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

Idiom #22 Convert string to integer

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

Imports
import std.conv;
Imports
import std.conv;
Code
auto i = s.to!int;
Code
auto i = s.to!int;
Comments bubble
the extremely useful 'to' function can convert just about anything to something else.
Comments bubble
the extremely useful 'to' function can convert just about anything to something else. It will throw on a non-integral input string.