The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,714 other followers

Archive for August 5th, 2015

Difference Between Int32.Parse, Convert.ToInt32, and Int32.TryParse – CodeProject

Posted by jpluimers on 2015/08/05

Every C#/VB/.NET developer should read Difference Between Int32.Parse, Convert.ToInt32, and Int32.TryParse – CodeProject.

Then also read TryParse with default values.

It is all about handling values that are not Integers, Overflow values and Nulls. There are subtle differences, in the handling of the methods, and the exceptions they could throw: ArgumentNullException, FormatException and OverflowException.

Finally read all about the NumberStyles enumeration, IFormatProvider interface and CultureInfo (especially the difference between InvariantCulture, CurrentCulture, CurrentUICulture and InstalledUICulture).

Because getting your conversions right matters.

–jeroen

Posted in .NET, Software Development, Development, C#, Prism, C# 2.0, C# 3.0, C# 4.0, VB.NET, Mono for Android, .NET 4.5, C# 5.0, C# 1.0, .NET 3.5, .NET 1.x, .NET 2.0, .NET 3.0, .NET 4.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0, VB.NET 10.0, VB.NET 11.0, RemObjects C#, Mono, C# 6 (Roslyn) | Leave a Comment »

 
%d bloggers like this: