k.go 243 B

123456789101112131415
  1. package kata
  2. func alphanumeric(str string) bool {
  3. if len(str) == 0 {
  4. return false
  5. }
  6. for _, r := range str {
  7. if !((r >= '0' && r <= '9') ||
  8. (r >= 'A' && r <= 'Z') ||
  9. (r >= 'a' && r <= 'z')) {
  10. return false
  11. }
  12. }
  13. return true
  14. }