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
+4.5k JQuery : Calling a function inside Jquery(document) block
+20.2k Golang : Saving private and public key to files
+14.8k Golang : How to get Unix file descriptor for console and file
+14.1k Golang : Find network of an IP address
+21k Golang : GORM create record or insert new record into database example
+6.8k Golang : Array mapping with Interface
+26.2k Golang : Convert file content into array of bytes
+48k Golang : Upload file from web browser to server
+18k Golang : Display list of time zones with GMT
+6.4k Mac OSX : Find large files by size
+22.6k Golang : Randomly pick an item from a slice/array example
+9.4k Golang : Function wrapper that takes arguments and return result example