标签:golang

1 篇文章

Go学习1 – 字符串相关
是否以xxx开头 package main import( "fmt" "strings" ) func main(){ name := "张三" result := strings.HasPrefix(name, "张") fmt.Println(result) //输出:true } 获取长度 ... import( "unicode/utf8…