Logo

Programming-Idioms

History of Idiom 22 > diff from v79 to v80

Edit summary for version 80 by S. K.:
New Csharp implementation by user [S. K.]

Version 79

2019-10-14, 12:23:23

Version 80

2019-10-23, 11:02:47

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
int i = int.Parse(s);
Comments bubble
defines integer i, and attempts to parse an integer value from s. The code will throw an error if s is not able to be converted. Int can be replaced with any number data type.