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.3k Golang : How to iterate a slice without using for loop?
+7.7k Golang : Generate human readable password
+6.8k Unix/Linux : How to fix CentOS yum duplicate glibc or device-mapper-libs dependency error?
+7.1k Golang : A simple forex opportunities scanner
+21.4k Curl usage examples with Golang
+31.5k Golang : bufio.NewReader.ReadLine to read file line by line
+17.5k Golang : Find smallest number in array
+15.4k Golang : Find location by IP address and display with Google Map
+7.1k Golang : Get Alexa ranking data example
+4.5k Java : Generate multiplication table example
+10.6k Golang : How to delete element(data) from map ?
+14.5k How to automatically restart your crashed Golang server