Using c# how do you convert a string value to a int value? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponses
+ 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