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
+10.9k Golang : Generate random elements without repetition or duplicate
+7.3k Linux : How to fix Brother HL-1110 printing blank page problem
+25.4k Golang : convert rune to integer value
+15.5k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+11.6k Golang : Calculations using complex numbers example
+30.3k Get client IP Address in Go
+23.8k Golang : Use regular expression to validate domain name
+12.5k Golang : Exit, terminating or aborting a program
+9.7k Golang : Qt get screen resolution and display on center example
+14.2k Golang : How to shuffle elements in array or slice?
+6.9k Web : How to see your website from different countries?