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
+9k Golang : Take screen shot of browser with JQuery example
+5k Unix/Linux : secure copying between servers with SCP command examples
+13k Golang : Add ASCII art to command line application launching process
+8.8k Golang : Progress bar with ∎ character
+13.8k Golang : Query string with space symbol %20 in between
+21.4k Golang : How to get time zone and load different time zone?
+6.2k Fontello : How to load and use fonts?
+10k Golang : Detect number of active displays and the display's resolution
+7.9k Gogland : Where to put source code files in package directory for rookie
+9.5k Golang : Launch Mac OS X Preview (or other OS) application from your program example
+15.2k Golang : How do I get the local IP (non-loopback) address ?