C# - Determines whether the specified input is numeric

By , 1/29/2007
(1 ratings)
Determines whether the specified input is numeric
/// <summary>
/// Determines whether the specified input is numeric.
/// </summary>
/// <param name="input">The input.</param>
/// <returns>
/// 	<c>true</c> if the specified input is numeric; otherwise, <c>false</c>.
/// </returns>
private static bool IsNumeric(string input)
{
    return System.Text.RegularExpressions.Regex.IsMatch(input, "^\\d+$");
}
Tagged with numeric, input.

Comments

 

Log in, to comment!