Skip to content

Instantly share code, notes, and snippets.

@WGrape
Created May 11, 2022 06:24
Show Gist options
  • Save WGrape/e6970dd35d3a42998bb35f389079f969 to your computer and use it in GitHub Desktop.
Save WGrape/e6970dd35d3a42998bb35f389079f969 to your computer and use it in GitHub Desktop.
The common utils in golang.
package utils
import "unicode"
// IsDigitString 是否为数字字符串
func IsDigitString(str string) bool {
for _, x := range []rune(str) {
if !unicode.IsDigit(x) {
return false
}
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment