+ 1

Using c# how do you convert a string value to a int value?

Example: fix dis code string num1 = Console.ReadLine( ); Console.WriteLine(num1 + 10);

24th Jul 2018, 5:51 PM
Darian Cornett
Darian Cornett - avatar
2 Antworten
+ 3
It is in the c# course, you do it like this: int age = Convert.ToInt32(Console.ReadLine())
24th Jul 2018, 7:07 PM
Paul
Paul - avatar
+ 2
aah, haven't reached that yet, thanks for the help
24th Jul 2018, 7:08 PM
Darian Cornett
Darian Cornett - avatar