golang中的strings.ToLower

 golang中的字符串操作strings.ToLower

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.ToLower(s)
        fmt.Println(ret) //hello world hello world
}

 


版权声明:本文为ma2595162349原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。