Numeric
C#
3
Posts
3
Posters
0
Views
1
Watching
-
Here is one possible test implementation, but of course exceptions should not really be used like this (it is bad because an exception takes so much time to handle).
try
{
Convert.ToInt32(myString);
}
catch
{
// myString is not a valid number
}
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)