ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

IsNumeric

Checks if a string value is numeric

Source

public static bool IsNumeric(this string value)
{
    Regex regex = new Regex(@"[0-9]");
    return regex.IsMatch(value);
}

Example

Public void Test()

Author: unknown

Submitted on: 22 apr. 2008

Language: C#

Type: System.String

Views: 7618