func String.IsNumeric() { try { parse(this) is Integer or Float } catch _ { false } } var str = "1234567" print(str.IsNumeric())