Problem with Convert.ToInt32 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem with Convert.ToInt32

how to resolve the problem when you enter a string and not a integer ? https://code.sololearn.com/chF8mhtKvFUq/#cs Thanks !

10th Mar 2020, 9:29 AM
said
3 Answers
+ 1
It works fine on me.
10th Mar 2020, 9:54 AM
Nootnoot
Nootnoot - avatar
+ 1
Either use: int.TryParse Or: Try/Except
10th Mar 2020, 10:03 AM
Mihai Apostol
Mihai Apostol - avatar
+ 1
Thanks. I have found
6th Jun 2020, 10:19 AM
said