private bool IsInteger(string strInput)
{
try
{
int.parse(strInput);
return true;
}
catch(Exception ex)
{
return false;
}
}
Subscribe to:
Post Comments (Atom)
Blog to help C# developer in writing complex code, solving issues/bugs
Good one, thanks.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteone more way:
ReplyDeleteprivate bool IsInteger(string strInput)
{
int i=0;
return int.TryParse(strInput,out i);
}