Snippet Fire

Beta
 Log In    |   Sign Up

.NET : Check if String Contains Only Numbers

Added on Jan-19-2012 by mikeSarg
For .NET

Tags : c#regexstring

This function returns true if the all the characters in a string are numeric.

DOWNLOAD

using System.Text.RegularExpressions; 


static bool AllNumeric(string inputString)
{
   return Regex.IsMatch(inputString, @"^\d+$");
}


    

Report Snippet

blog comments powered by Disqus