Golang Convert String to Lowercase - ToLower() - Example
Golang Convert String to Lowercase ? ToLower() ? Example
Golang ? String to Lowercase
To convert string to lowercase in Golang, you can use strings.ToLower() function. The syntax of ToLower() function is:
strings.ToLower(str)
where
1. strings is the package 2. ToLower is the keyword 3. str is the input string
strings.ToLower() function returns string with all character converted to lower case alphabets.
In this tutorial, we will learn how to transform a string to lower case in Golang.
Golang Example to Convert String to Lower Case
In this example, we will take a string containing a mix of lower and upper case alphabets and convert it to lower case.
example.go
package main import (
"fmt" "strings" ) func main() { var str = "HelLo WoRld" var str_lower = strings.ToLower(str) fmt.Printf(str_lower) }
Output
C:\workspace\go>go run example.go hello world
Conclusion
In this Golang Tutorial, we learned how to convert a string to lower case.
Golang Golang Tutorial Run Golang Program Golang If Else Golang Switch Golang For Loop Golang Comments Golang Functions Golang Array Golang Slice Golang Struct Golang Class Golang Range Golang Map Golang Goroutine Golang Channel
Golang String Operations Golang String Length Golang String Concatenation Golang Split String Golang String - Get Index of Substr Golang String to Uppercase
Golang String to Lowercase Golang Convert String to Integer
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- golang int to int32
- a tour of go swtch
- golang convert string to lowercase tolower example
- sparql by example the cheat sheet
- parse string to int golang
- golang convert string to uppercase toupper example
- how to convert string to integer in golang
- how to check if string ends with a suffix string in go
- the go programming language part 1
- golang int to str
Related searches
- convert string to string array java
- golang convert float to int
- golang convert int to float64
- convert string to string array
- golang convert int to uint
- golang convert int to int32
- golang convert uint to int
- golang convert int to int64
- golang convert interface to int
- golang convert int to float
- golang convert int to string
- golang convert string to int64