Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
feat(#1518): check alphabet go (#6453)
Browse files Browse the repository at this point in the history
  • Loading branch information
sancoLgates committed Feb 27, 2023
1 parent ec79dff commit 78852bd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions program/check-alphabet/check_alphabet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"regexp"
)

var isAlphabet = regexp.MustCompile(`^[a-zA-Z]`).MatchString

func main() {
var str string
fmt.Print("Input a character: ")
fmt.Scan(&str)

if (isAlphabet(str)) {
fmt.Println("Alphabet")
} else {
fmt.Println("Non Alphabet")
}
}

0 comments on commit 78852bd

Please sign in to comment.