我是靠谱客的博主 岁月静好,这篇文章主要介绍GoLang之标准库unicode包,现在分享给大家,希望可以做个参考。

基于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
}


最后

以上就是岁月静好最近收集整理的关于GoLang之标准库unicode包的全部内容,更多相关GoLang之标准库unicode包内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(544)

评论列表共有 0 条评论

立即
投稿
返回
顶部