Go语言学习之strings包(the way to go)

一时失言乱红尘 2022-06-13 11:58 358阅读 0赞

生命不止,继续 go go go !!!

今天跟大家分享的是stirngs包,为我们提供了一些方便的字符串操作。这里需要注意一下,不引入strings包同样是可以使用string定义变量的。

之前的博客结果过string的用法:
Go语言学习之字符串(The way to go)

import “strings”
官方描述:
Package strings implements simple functions to manipulate UTF-8 encoded strings.

看到了吧,是UTF-8编码的字符串。

注意是看一些方法:

转换相关的方法

  1. func ToUpper(s string) string
  2. func ToLower(s string) string
  3. func ToTitle(s string) string
  4. func</

发表评论

表情:
评论列表 (有 0 条评论,358人围观)

还没有评论,来说两句吧...

相关阅读