Open In App

strings.Title() Function in Golang With Examples

Last Updated : 19 Apr, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
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: C
// Golang program to illustrate the strings.Title() function

package main

import (
    "fmt"
    "strings"
)

// Main function
func main() {
    fmt.Println(strings.Title("geeks for geeks"))
}
Output:
Geeks For Geeks
Example 2: C
// Golang program to illustrate the strings.Title() function

package main

import (
    "fmt"
    "strings"
)

// Main function
func main() {
    fmt.Println(strings.Title("computer science portal"))
}
Output:
Computer Science Portal

Next Article
Article Tags :

Similar Reads