GoFrame gstr-字符串判断
2022-04-11 15:25 更新
IsNumeric
- 说明:
IsNumeric验证字符串s是否为数字。 - 格式:
IsNumeric(s string) bool- 示例:
func ExampleIsNumeric() {
fmt.Println(gstr.IsNumeric("88"))
fmt.Println(gstr.IsNumeric("3.1415926"))
fmt.Println(gstr.IsNumeric("abc"))
// Output:
// true
// true
// false
}以上内容是否对您有帮助:

免费 AI IDE


更多建议: