public bool IsInteger(string strNumber) { Regex objNotIntPattern = new Regex("[^0-9-]"); Regex objIntPattern = new Regex("^-[0-9]+$|^[0-9]+$"); return !objNotIntPattern.IsMatch(strNumber) && objIntPattern.IsMatch(strNumber); } |
Friday, October 03, 2008
IsInteger Function in C#
Posted by Sanjay Sansanwal at 10:48 am 1 comments
Labels: Dot NET
Subscribe to:
Posts (Atom)