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
+8.3k Swift : Convert (cast) Character to Integer?
+14.4k Golang : How to convert a number to words
+21.3k Golang : Create and resolve(read) symbolic links
+8.2k Golang : Qt splash screen with delay example
+11k Golang : Replace a parameter's value inside a configuration file example
+6.8k Golang : Find the longest line of text example
+25.7k Golang : How to write CSV data to file
+12.9k Python : Convert IPv6 address to decimal and back to IPv6
+8.2k Prevent Write failed: Broken pipe problem during ssh session with screen command
+16.9k Golang : Set up source IP address before making HTTP request
+9.5k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases
+26.4k Golang : Get executable name behind process ID example