TheSwamp

Code Red => .NET => Topic started by: Kerry on February 05, 2006, 09:01:32 PM

Title: TryParse for NET 2.0
Post by: Kerry on February 05, 2006, 09:01:32 PM
If you're a little tired of wrapping for Exceptions when using the Type.Parse(..) with NET 1.x ,

have a look at Type.TryParse(..) with NET 2.0 .. very nice I think ..

Code: [Select]
        static void ParseStuff()
        {
            string xString = "5";
            int xInt;

            bool result = int.TryParse(xString, out xInt);
        }
    }