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
+10.1k Golang : Compare files modify date example
+20.2k Golang : Determine if directory is empty with os.File.Readdir() function
+12.9k Golang : Convert IPv4 address to packed 32-bit binary format
+10.6k Android Studio : Simple input textbox and intercept key example
+30.6k Golang : Remove characters from string example
+7.2k Golang : Use modern ciphers only in secure connection
+5.3k PHP : Hide PHP version information from curl
+14k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+8.6k Golang : Progress bar with ∎ character
+6.2k Golang : Process non-XML/JSON formatted ASCII text file example
+21.3k Golang : Create and resolve(read) symbolic links
+6.6k Golang : How to determine if request or crawl is from Google robots