Skip to content
Related Articles

Related Articles

Improve Article
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:




// 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:




// 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
My Personal Notes arrow_drop_up
Recommended Articles
Page :