Golang strings包的TrimRight和TrimSuffix的区别
昨天遇到一个问题,strings.TrimRight("cyeamblog.go", ".go")结果居然是"cyeambl",这让我百思不得其解。当然,要看官方文档的解释: func TrimRight(s string, cutset string) string TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed. func ...阅读全文