Menu Close

Go – How to convert strings into lower case in go

Here, We will learn how to convert strings into lower case in go. We can do it by using ToLower() function in strings package in go golang.

Function prototype:

func ToLower(str string) string

Return value:

ToLower() function in strings package returns 
strings with all Unicode letters mapped to
their lower case.

Example with code:

package main

import (

func main() {

  s := strings.ToLower("Go GoLang")

  s = strings.ToLower("go golang")

  s = strings.ToLower("Go GoLang 123 #")

  s = strings.ToLower("0 9 # Go GoLang ")


go golang
go golang
go golang 123#
0 9 # go golang

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

Posted in golang, strings

Leave a Reply

Your email address will not be published. Required fields are marked *