GoFrame gstr-字符串判斷

2022-04-11 15:25 更新

IsNumeric

  • 說明:?IsNumeric?驗證字符串?s?是否為數(shù)字。  
  • 格式:

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

公眾號
微信公眾號

編程獅公眾號