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:
package main
import (
"fmt"
"strings"
"unicode"
)
func main() {
fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "geeks for geeks" ))
}
|
Output:
GEEKS FOR GEEKS
Example 2:
package main
import (
"fmt"
"strings"
"unicode"
)
func main() {
fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "I am a student" ))
}
|
Output:
I AM A STUDENT
Last Updated :
19 May, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...