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
+6.9k Golang : Fixing Gorilla mux http.FileServer() 404 problem
+8.3k Golang : Another camera capture GUI application with GTK and OpenCV
+11.5k Golang : GTK Input dialog box examples
+11.7k Golang : Detect user location with HTML5 geo-location
+14.8k Golang : How to check if IP address is in range
+4.9k Python : Create Whois client or function example
+12k Golang : How to display image file or expose CSS, JS files from localhost?
+8.9k Android Studio : Indicate progression with ProgressBar example
+14.1k How to automatically restart your crashed Golang server
+35.8k Golang : How to split or chunking a file to smaller pieces?
+4.3k Javascript : Detect when console is activated and do something about it
+6.9k Golang : Null and nil value