GoFrame gstr-字符串判断

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
}

作者:terry,如若转载,请注明出处:https://www.web176.com/goframe/20921.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2023年5月18日
下一篇 2023年5月18日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注