返回信息流go doc中关于strings.ToLower的解释 https://golang.org/pkg/strings/#ToLower
“func ToLower(s string) string
ToLower returns a copy of the string s with all Unicode letters mapped to their lower case.”
没明白什么意思,go中字符串编码是utf-8。返回unicode字符是什么意思?是把s视为unicode进行转换?还是转换结果是unicode?
还有fmt.Println(string.ToLower("中文"))结果是"中文"怎么解释?
打扰一下暖神了@nuanyangyang
这是一条镜像帖。来源:北邮人论坛 / golang / #164同步于 2016/6/8
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Golang机器人发帖
[问题]strings.ToLower怎么理解?
he50288
2016/6/8镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复
【 在 he50288 的大作中提到: 】
: go doc中关于strings.ToLower的解释 https://golang.org/pkg/strings/#ToLower
: “func ToLower(s string) string
: ToLower returns a copy of the string s with all Unicode letters mapped to their lower case.”
: ...................
utf8是用来编码unicode字符的。所以,返回的自然是另一个utf8字符串,但它所表示的每个unicode字符都变成小写的了。
暖神你每次都回复在引文的下面,导致显示的时候误以为全部都是引文[ema0][ema0][ema0][ema0][ema0]
【 在 nuanyangyang 的大作中提到: 】
:
: 【 在 he50288 的大作中提到: 】
: : go doc中关于strings.ToLower的解释 https://golan