Golang : Strings to lowercase and uppercase example
A quick and short tutorial on how to change uppercase characters to lower case and vice-versa. If you string value is in byte format, please refer to https://www.socketloop.com/references/golang-bytes-tolower-function-example and https://www.socketloop.com/references/golang-bytes-toupper-function-example
package main
import (
"fmt"
"strings"
)
func main() {
upperStr := "ABCDEF"
fmt.Println(strings.ToLower(upperStr))
lowerStr := "wxyz"
fmt.Println(strings.ToUpper(lowerStr))
}
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+19.1k Golang : Get host name or domain name from IP address
+14.4k Golang : Missing Bazaar command
+9.2k Golang : How to protect your source code from client, hosting company or hacker?
+6.4k Golang : Convert an executable file into []byte example
+4.4k Java : Generate multiplication table example
+5.7k Golang : List all packages and search for certain package
+4.9k Golang : Get a list of crosses(instruments) available to trade from Oanda account
+20.7k Golang : Underscore or snake_case to camel case example
+4.2k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+14.2k Golang : Recombine chunked files example
+8.1k Golang : Check if integer is power of four example
+6.2k Golang : How to search a list of records or data structures