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
+13.2k Golang : Reset buffer example
+10k Golang : Create S3 bucket with official aws-sdk-go package
+11.4k Swift : Convert (cast) Int or int32 value to CGFloat
+5.2k Golang : Experimental emojis or emoticons icons programming language
+23.7k Golang : Storing cookies in http.CookieJar example
+6.3k Golang : Process json data with Jason package
+18.9k Golang : How to get struct tag and use field name to retrieve data?
+14k Golang : Get timezone offset from date or timestamp
+3.8k Facebook : How to place save to Facebook button on your website
+5.7k Golang : Muxing with Martini example
+10.3k Golang : Display a text file line by line with line number example
+12.9k Golang : Google Drive API upload and rename example