Golang bytes.Title() function example
package bytes
Title returns a copy of of the given input string with all Unicode letters that begin words mapped to their title case.
Golang bytes.Title() function usage example
package main
import (
"bytes"
"fmt"
)
func main() {
str := []byte("this is a title!")
title := bytes.Title(str)
fmt.Println(string(str))
fmt.Println(string(title))
}
Output :
this is a title!
This Is A Title!
Reference :
Advertisement
Something interesting
Tutorials
+12.3k Golang : Get month name from date example
+11.6k Golang : Fuzzy string search or approximate string matching example
+39.2k Golang : How to read CSV file
+7.9k Swift : Convert (cast) String to Float
+24.5k Golang : Change file read or write permission example
+10.5k Generate Random number with math/rand in Go
+31.1k Golang : Calculate percentage change of two values
+29.9k Golang : How to get HTTP request header information?
+23.1k Golang : Randomly pick an item from a slice/array example
+15.7k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+7.3k Golang : alternative to os.Exit() function
+8.6k Android Studio : Import third-party library or package into Gradle Scripts