Difference between int.Parse() and Convert.ToInt32 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Difference between int.Parse() and Convert.ToInt32

Can anyone tell me what is the difference between int.Parse() and Convert.ToInt32 ?

17th May 2017, 5:55 PM
Adrian Szlegel
Adrian Szlegel - avatar
3 Respostas
+ 5
They work pretty much the same way, except that Convert.ToInt32() does not throwĀ ArgumentNullExceptionĀ when its argument is nullĀ ā€“ Int.Parse does. Source: http://stackoverflow.com/questions/199470/whats-the-main-difference-between-int-parse-and-convert-toint32
19th May 2017, 5:14 AM
Ɓlvaro
+ 2
thx!
19th May 2017, 6:42 AM
Adrian Szlegel
Adrian Szlegel - avatar
+ 2
Good to know
27th May 2017, 12:11 AM
Keila Nayara EnƩas da Silva
Keila Nayara EnƩas da Silva - avatar