static void Main(string[] args)
{
bool res = isNumberic1("123.5");
Console.WriteLine(res);
res = isNumberic1("5.0");
Console.WriteLine(res);
res = isNumberic1("abc");
Console.WriteLine(res);
}
static bool isNumberic1(string _string)
{
string pattern = @"\d+\.?\d*|\.\d+";
if (Regex.IsMatch(_string, pattern))
return true;
else
return false;
}