基于Windos系统上Go SDK v1.8进行讲解

1.IsLetter函数

image-20220131152844999

image-20220131154951725

image-20220131161434449

image-20220131161504203

2.IsLower函数

image-20220131155205950

3.IsUpper函数

image-20220131155216475

4.ToLower函数

image-20220131155239590

5.ToUpper函数

image-20220131155310677

6.IsNumber函数

image-20220131160007378

image-20220131155944497

7.IsDigit函数

image-20220131160514902

image-20220131162001394

8.IsPunct函数

IsPunct报告一个字符是否是unicode标点字符

func IsPunct(r rune) bool

func main() {
	fmt.Println(unicode.IsPunct(','))                      //true
	fmt.Println(unicode.IsPunct('+'))                      //false
	fmt.Println(unicode.IsPunct('a'))                      //false
	fmt.Println(unicode.IsPunct(' '))                      //false
	fmt.Println(unicode.IsPunct('\''))                     //true
	fmt.Println(unicode.IsPunct('_'))                      //true
	fmt.Println(unicode.IsPunct('-'))                      //true
}


点赞(371)

评论列表共有 0 条评论

立即
投稿
返回
顶部