阅读(3778) (5)

GoFrame gstr-字符串判断

2022-04-11 15:13:01 更新

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
}