go-rfc2234/alpha.go

19 lines
303 B
Go
Raw Normal View History

2023-10-04 08:36:46 +00:00
package rfc2234
// IsAlpha returns true if the value of 'r' matches 'ALPHA' as defined in IETF RFC-2234:
//
// ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
func IsAlpha(r rune) bool {
if 'z' < r {
return false
}
if r < 'A' {
return false
}
if 'Z' < r && r < 'a'{
return false
}
return true
}