<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnet.org.za/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Bumpy Blog - All Comments</title><link>http://dotnet.org.za/deonvs/default.aspx</link><description>Bumpy's Bedside Story</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#531320</link><pubDate>Mon, 18 Aug 2008 06:34:23 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:531320</guid><dc:creator>Praveen</dc:creator><description>&lt;p&gt;In .Net 2005 the best form of IsNumeric is as follows.&lt;/p&gt;
&lt;p&gt;public static bool IsNumeric(string argument)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float result ;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return float.TryParse(argument,out result);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=531320" width="1" height="1"&gt;</description></item><item><title>Ultimate Solutions from IT Expert &amp;raquo; isNumeric in c#</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#516296</link><pubDate>Fri, 08 Aug 2008 09:05:45 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:516296</guid><dc:creator>Ultimate Solutions from IT Expert » isNumeric in c#</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Ultimate Solutions from IT Expert &amp;amp;raquo; isNumeric in c#&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=516296" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#513507</link><pubDate>Wed, 06 Aug 2008 16:28:49 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:513507</guid><dc:creator>Wilby Jackson</dc:creator><description>&lt;p&gt;Revised to actually check for a number either int or decimal.&lt;/p&gt;
&lt;p&gt; public static bool isNumeric(string str)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //number of decimals in string&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int decCounter = 0;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //loop through checking each char for a number or dec.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (char c in str)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!char.IsNumber(c) &amp;amp;&amp;amp; !c.Equals('.'))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (c.Equals('.') &amp;amp;&amp;amp; decCounter &amp;gt;= 1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (c.Equals('.'))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;decCounter += 1;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//before returning true make sure there is not a decimal at the end of the string&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!(decCounter &amp;gt; 1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=513507" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#502059</link><pubDate>Thu, 31 Jul 2008 23:14:40 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:502059</guid><dc:creator>Deon van Staden</dc:creator><description>&lt;p&gt;Looking at this old blog, I decided to add something else. &amp;nbsp;I found this very nice link and thought I should share it.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://sadeveloper.net/forums/thread/8887.aspx"&gt;sadeveloper.net/.../8887.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The part I really agree with it w.r.t. RegEx.&lt;/p&gt;
&lt;p&gt;Here is a snippet from the post:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Define a regular expression for currency values.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Regex rx = new Regex(@&amp;quot;^-?\d+(\.\d{2})?$&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Define some test strings.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;string[] tests = {&amp;quot;-42&amp;quot;, &amp;quot;19.99&amp;quot;, &amp;quot;0.001&amp;quot;, &amp;quot;100 USD&amp;quot;};&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Check each test string against the regular expression.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (string test in tests)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (rx.IsMatch(test))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;{0} is a currency value.&amp;quot;, test);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;{0} is not a currency value.&amp;quot;, test);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;And then this part also enhances this a lot:&lt;/p&gt;
&lt;p&gt;To add negative validation to the beginning, start the regular expression with an optional hyphen.&lt;/p&gt;
&lt;p&gt;Immediately after the &amp;quot;start of text&amp;quot; marker (which looks like &amp;quot;^&amp;quot;) put in a hyphen and a question mark. &amp;nbsp;The question mark allows zero or one of the preceding character (a hyphen) but no more.&lt;/p&gt;
&lt;p&gt;^-?\d+$ &amp;nbsp;(this is for negative and positive integers)&lt;/p&gt;
&lt;p&gt;^-?\d+([\.]{1}\d*)?$ (this is for negative and positive decimals)&lt;/p&gt;
&lt;p&gt;Spread the word about Regular Expressions. &amp;nbsp;I love them. &amp;nbsp; They become much easier if you use a tool like &amp;quot;Expresso&amp;quot;. I have created a regular expression that I use to validate password complexity in javascript on the client browser (more than 6 chars, includes number or capitals or special characters in various combinations - its one long string or about five readable lines when broken apart).&lt;/p&gt;
&lt;p&gt;Thanks jamesh. &amp;nbsp;I think this one wins the competition thus far. &amp;nbsp;I would like to see what Microsoft is going to come up with when they wake up with IsNumeric?&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=502059" width="1" height="1"&gt;</description></item><item><title>re: Mobile content sites!!!</title><link>http://dotnet.org.za/deonvs/archive/2005/07/19/39651.aspx#486822</link><pubDate>Mon, 21 Jul 2008 12:17:54 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:486822</guid><dc:creator>oooberman</dc:creator><description>&lt;p&gt;Well guys why dont you try out my site. you can sell ringtones here too. plus we have main stream as well as user-generated content and there are some masterpieces. check out www.ooober.mobi . sorry if anyone is offended by this attempt at marketing. sales ppl dont get any respect these days !!&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=486822" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#481901</link><pubDate>Wed, 16 Jul 2008 08:08:49 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:481901</guid><dc:creator>zamkinos</dc:creator><description>&lt;p&gt;thanks a lot.&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=481901" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#459136</link><pubDate>Thu, 19 Jun 2008 11:36:05 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:459136</guid><dc:creator>James McConville</dc:creator><description>&lt;p&gt;I Like this method... (apologies if its already on the coversation, i didn't read all the posts)&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;int output;&lt;/p&gt;
&lt;p&gt;if (int.TryParse(&amp;quot;123&amp;quot;, out output))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=459136" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#445546</link><pubDate>Tue, 03 Jun 2008 18:59:19 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:445546</guid><dc:creator>Wilby Jackson</dc:creator><description>&lt;p&gt;This also works as a replacement:&lt;/p&gt;
&lt;p&gt; public bool isNumeric(string str)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bool isNumber = false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (char c in str)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (char.IsNumber(c))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;isNumber = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return isNumber;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=445546" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#440119</link><pubDate>Wed, 28 May 2008 13:15:09 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:440119</guid><dc:creator>Ken Palmer</dc:creator><description>&lt;p&gt;TryParse() is a viable alternative to Try/Catch. When a conversion fails it returns False rather than an exception.&lt;/p&gt;
&lt;p&gt;The code I'm using below was adapted from Microsoft and Scott Hanselman's blog:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/kb/329488"&gt;support.microsoft.com/.../329488&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.hanselman.com/blog/ExploringIsNumericForC.aspx"&gt;www.hanselman.com/.../ExploringIsNumericForC.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;public static bool IsNumeric(object expression)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if (expression == null) { return false; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;double retNum; // Collects out parameter of TryParse(). &amp;nbsp;If conversion fails the out parameter is zero.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// TryParse() returns True when conversion passes and False when conversion fails. &amp;nbsp;It doesn't generate an exception.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return Double.TryParse(Convert.ToString(expression), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=440119" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#427619</link><pubDate>Fri, 25 Apr 2008 06:00:10 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:427619</guid><dc:creator>senthilkumar</dc:creator><description>&lt;p&gt; protected bool CheckforNumber(string strNumber)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{ &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Int64 no1 = Convert.ToInt64(strNumber);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch (FormatException FE)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=427619" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#427618</link><pubDate>Fri, 25 Apr 2008 05:57:25 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:427618</guid><dc:creator>senthil</dc:creator><description>&lt;p&gt; protected bool CheckforNumber()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string no = &amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Int64 no1 = Convert.ToInt64(no);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch (FormatException FE)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=427618" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#388216</link><pubDate>Thu, 20 Mar 2008 20:58:53 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:388216</guid><dc:creator>Dave</dc:creator><description>&lt;p&gt;Using the VB namespace is the best way to go. Just look at how many code samples were presented with errors.&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=388216" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#384311</link><pubDate>Tue, 18 Mar 2008 13:32:09 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:384311</guid><dc:creator>sambo</dc:creator><description>&lt;p&gt;private bool IsNumeric(string inputString)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; return Regex.IsMatch(inputString, &amp;quot;^[0-9]+$&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Good practice and performance, my think.&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=384311" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#297645</link><pubDate>Mon, 28 Jan 2008 10:37:30 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:297645</guid><dc:creator>Txomin</dc:creator><description>&lt;p&gt;This one matches thousand separators &lt;/p&gt;
&lt;p&gt;private bool isNumeric(string stringToCheck) &lt;/p&gt;
&lt;p&gt;		{&lt;/p&gt;
&lt;p&gt;			System.Text.RegularExpressions.Regex _isNumber = &lt;/p&gt;
&lt;p&gt;						new System.Text.RegularExpressions.Regex&lt;/p&gt;
&lt;p&gt;						(@&amp;quot;(^[-+]?\d+(,?\d*)*\.?\d*([Ee][-+]\d*)?$)|(^[-+]?\d?(,?\d*)*\.\d+([Ee][-+]\d*)?$)&amp;quot;);&lt;/p&gt;
&lt;p&gt;			return _isNumber.Match(stringToCheck).Success;&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=297645" width="1" height="1"&gt;</description></item><item><title>re: IsNumeric in C#, WHY NOT?</title><link>http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx#218472</link><pubDate>Thu, 25 Oct 2007 14:45:38 GMT</pubDate><guid isPermaLink="false">2d3a9e08-b70c-4031-ba2b-8f5282a2a59a:218472</guid><dc:creator>Chris Tagg</dc:creator><description>&lt;p&gt;Any ideas for an IsDate()?&lt;/p&gt;
&lt;img src="http://dotnet.org.za/aggbug.aspx?PostID=218472" width="1" height="1"&gt;</description></item></channel></rss>