Menu Close

Go – ToLowerSpecial() function in strings package in go

Here, We will learn about ToLowerSpecial() function in strings package in go.  ToLowerSpecial() function is used to get a copy of the string with all Unicode letters mapped to their lower case using the case mapping specified by SpecialCase structure in unicode package in go golang.

Function prototype:

func ToLowerSpecial(c unicode.SpecialCase, str string) string

Return value:

ToLowerSpecial() function in strings package 
returns a copy of the string str with all
Unicode letters mapped to their lower case using
the case mapping specified by c.

Example with code:

package main

import (
  "fmt"
  "strings"
)

func main() {

  s := strings.Title("Hello google")
  fmt.Println(s)
	
  s = strings.Title("Hello go golang")
  fmt.Println(s)

  s = strings.Title("Hey Jon !!!")
  fmt.Println(s)

  s = strings.Title("Teremenm fr # $kk ")
  fmt.Println(s)
}

Output:

Hello Google
Hello Go Golang
Hey Jon !!!
Teremenm Fr # $Kk

To learn more about golang, Please refer given below link:

https://www.techieindoor.com/go-lang-tutorial/

References:

https://golang.org/doc/
https://golang.org/pkg/
Posted in golang, strings

Leave a Reply

Your email address will not be published.

Contact Us