Kick Off the Blog with a TryParse sample!
Well, I though I would kick off the BCL blog with a sample of TryParse. TryParse methods have been added to all the base datatypes in Whidbey (previously, TryParse was only available on the Double type). The TryParse demo is available on the new BCL website. The demo allows you to compare the speed of Parse on certain types, to TryParse, and clearly demonstrates why you should prefer TryParse!
Comments
- Anonymous
November 03, 2003
I am very happy to see this being addressed! - Anonymous
November 07, 2003
Thanks Frank! - Anonymous
January 23, 2004
Hey Kit, if I wanted to categorize parse and tryparse, are they from the Microsoft.Jscript.IParseText interface? - Anonymous
March 26, 2004
I guess TryParse is a Whidbey feature, in .net 1.1, this works:
Regex.IsMatch(datapointer, @"^[-+]?[0-9]d.?[0]$") - Anonymous
June 12, 2007
PingBack from http://novaxo.wordpress.com/2007/06/12/tryparse-and-the-exception-tax/