public bool isValid(String s) { try { Double.Parse(s); return true; } catch (Exception) { return false; } }