基于Windos系统上Go SDK v1.8进行讲解
1.IsLetter函数
2.IsLower函数
3.IsUpper函数
4.ToLower函数
5.ToUpper函数
6.IsNumber函数
7.IsDigit函数
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包内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。












发表评论 取消回复