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
+11k Golang : Generate random elements without repetition or duplicate
+4.6k Linux : sudo yum updates not working
+11.7k Golang : Calculations using complex numbers example
+25.3k Golang : Get current file path of a file or executable
+35.3k Golang : Strip slashes from string example
+12k Golang : Convert a rune to unicode style string \u
+9.2k Golang : Write multiple lines or divide string into multiple lines
+18.2k Golang : Get path name to current directory or folder
+10.5k Swift : Convert (cast) String to Integer
+29.8k Golang : Get and Set User-Agent examples
+7.8k Golang : Scan files for certain pattern and rename part of the files
+5.2k Python : Create Whois client or function example