strings.ToTitleSpecial() Function in Golang With Examples

strings.ToTitleSpecial() Function in Golang is used to returns a copy of the string s with all Unicode letters mapped to their Unicode title case, giving priority to the special casing rules.

Syntax:

func ToTitleSpecial(c unicode.SpecialCase, s string) string

Here, c is the case mapping and s is the specified string.

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

// Golang program to illustrate
// the strings.ToTitleSpecial Function
package main
  
import (
    "fmt"
    "strings"
    "unicode"
)
  
func main() {
  
    // using the function
    fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "geeks for geeks"))
}

chevron_right


Output:

GEEKS FOR GEEKS

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

// Golang program to illustrate
// the strings.ToTitleSpecial Function
package main
  
import (
    "fmt"
    "strings"
    "unicode"
)
  
func main() {
  
    // using the function
    fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "I am a student"))
}

chevron_right


Output:

I AM A STUDENT
My Personal Notes arrow_drop_up

Recommended Posts:

    Article Tags :

    Be the First to upvote.


    Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.