I think all other solutions works fine, but String Builder struct exists 
for the same reason.

package main

import (
    "fmt"
    "strings"    

)

func ToLowerCase(str string) string {

    var b strings.Builder    

    b.WriteString(strings.ToLower(string(str[0])))    
    b.WriteString(str[1:])
        
    return b.String()

}

func main() {
    var str string = "GoLang"
    fmt.Println(ToLowerCase(str))
}



Playground here: https://play.golang.org/p/aAyBGnM5p2x

On Saturday, 24 November 2012 11:51:23 UTC+1, Nikolai wrote:
>
> Hi!
>
> What is the easiest way to make a string "LikeThis" --> "likeThis"?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/59ede7f8-bfb9-44a0-9fa7-cef1d7288983o%40googlegroups.com.

Reply via email to