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

feat(#1518): check alphabet go #6453

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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")
}
}