Use function of VB.NET in C#
C#
4
Posts
4
Posters
0
Views
1
Watching
-
I think this would work, haven't had time to test it though add a reference to the Microsoft.VisualBasic.dll Microsoft.VisualBasic.Information.IsNumeric( Object ) HTH Russ
-
I think this would work, haven't had time to test it though add a reference to the Microsoft.VisualBasic.dll Microsoft.VisualBasic.Information.IsNumeric( Object ) HTH Russ
-
Well the crazy way would be bool isnumeric = false; try { Convert.Int32(Object) } catch { isNumeric = true; } //use the isnumeric now
Not quite... the
isNumeric=true;
has to follow theConvert.ToInt32()
. Or useDouble.TryParse()
to test without having to throw excaptions. Regards, mav