golang中字符串操做strings.ToUpperhtml
package main import ( "fmt" "strings" ) //golang字符串操做 func main(){ s := "hello world hello world" //str := "wo" //var s = []string{"11","22","33"} //将s中的全部字符修改成其大写格式。对于非ASCII字符,它的大写格式须要查表转换 ret := strings.ToUpper(s) fmt.Println(ret) //HELLO WORLD HELLO WORLD }