May be this?

func main() {
    myString := "LikeThis"
    print(strings.ToLower(myString[:1]) + myString[1:])
}
On Friday, 19 June 2020 at 01:48:23 UTC+5:30 leonidas...@gmail.com wrote:

>
>
> package main
>
> import (
> "fmt"
> "unicode"
>
> )
>
> func main() {
> fmt.Println(MakeFirstLowerCase("LikeThis")) 
>
> }
>
> func MakeFirstLowerCase(s string) string {
>     if len(s)==0 {
>        return s
>     }   
>     
>     r := []rune(s)    
>     r[0] = unicode.ToLower(r[0])
>     return string(r)   
> }
>
> On Thu, Jun 18, 2020 at 10:38 AM <naren.y...@tradebyte.com> wrote:
>
>> 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 golang-nuts...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/59ede7f8-bfb9-44a0-9fa7-cef1d7288983o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/59ede7f8-bfb9-44a0-9fa7-cef1d7288983o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4c4521fa-3bb8-48c3-bf68-742c248739ddn%40googlegroups.com.

Reply via email to