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
+7.8k Golang : Example of how to detect which type of script a word belongs to
+10.7k Golang : Get currencies exchange rates example
+51.9k Golang : How to get time in milliseconds?
+9k Golang : automatically figure out array length(size) with three dots
+7.1k Golang : Gorrila mux.Vars() function example
+11.2k Golang : Proper way to test CIDR membership of an IP 4 or 6 address example
+14.4k Golang : On enumeration
+29.7k Golang : Record voice(audio) from microphone to .WAV file
+16.4k Golang : How to implement two-factor authentication?
+5.4k Golang : Reclaim memory occupied by make() example
+14.8k Golang : Get URI segments by number and assign as variable example
+5k Python : Convert(cast) bytes to string example