golang中的字符串操作strings.ToTitle
package main
import (
"fmt"
"strings"
)
//golang字符串操作
func main(){
s := "Hello world hello world"
//str := "wo"
//var s = []string{"11","22","33"}
//将s中的所有字符修改为其Title格式,大部分字符的Title格式就是Upper格式,
//只有少数字符的Title格式是特殊字符。这里的ToTitle主要给Title函数调用
ret := strings.ToTitle(s)
fmt.Println(ret) //HELLO WORLD HELLO WORLD
}