How to check if character is letter in Go

1 Answer

0 votes
package main

import (
	"fmt"
	"unicode"
)

func main() {
	ch := 'a'
	if unicode.IsLetter(ch) {
		fmt.Println("yes")
	} else {
		fmt.Println("no")
	}
}



/*
run:

yes

*/

 



answered Jan 2, 2025 by avibootz
...