strings.Title() Function in Golang With Examples
Last Updated :
19 Apr, 2020
strings.Title() Function returns a copy of string s with all Unicode letters of string whose begin words mapped to their Unicode title case. This method belongs to the strings package.
Syntax:
func Title(s string) string
It returns the string.
Example 1:
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Println(strings.Title( "geeks for geeks" ))
}
|
Output:
Geeks For Geeks
Example 2:
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Println(strings.Title( "computer science portal" ))
}
|
Output:
Computer Science Portal
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...