github.com/go-playground/pkg/v5@v5.29.1/ascii/helpers.go (about) 1 package asciiext 2 3 // IsAlphanumeric returns true if the byte is an ASCII letter or digit. 4 func IsAlphanumeric(c byte) bool { 5 return IsLower(c) || IsUpper(c) || IsDigit(c) 6 } 7 8 // IsUpper returns true if the byte is an ASCII uppercase letter. 9 func IsUpper(c byte) bool { 10 return c >= 'A' && c <= 'Z' 11 } 12 13 // IsLower returns true if the byte is an ASCII lowercase letter. 14 func IsLower(c byte) bool { 15 return c >= 'a' && c <= 'z' 16 } 17 18 // IsDigit returns true if the byte is an ASCII digit. 19 func IsDigit(c byte) bool { 20 return c >= '0' && c <= '9' 21 }