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
}


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号