public static bool IsNum(String str){ for (int i = 0; i < str.Length; i++) { if (!char.IsNumber(str, i)) return false; } return true;}
这个应该效率比较高的吧,不过还没有测试过。