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
+3.1k Golang : PGX CopyFrom to insert rows into Postgres database
+5.2k Golang : How to solve "too many .rsrc sections" error?
+8.6k Golang : Turn string or text file into slice example
+14.2k Golang : Delete certain files in a directory
+29.3k Golang : Download file example
+17.8k Golang : Get RGBA values of each image pixel
+3.7k Chrome : How to block socketloop.com links in Google SERP?
+3.7k MariaDB/MySQL : How to get version information
+12.8k Android Studio : Use image as AlertDialog title with custom layout example
+18.6k Golang : Set or Add HTTP Request Headers
+8.6k Golang : Eroding and dilating image with OpenCV example
+6k Golang : How to detect if a sentence ends with a punctuation?