Convert.ToInt32 can take various types, including string, in which case
it parses the string. It will also always detect overflows. Casting
only works if the "source" type has an explicit or implicit conversion
operator to int.
Casting will generally be faster where it's available.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.