1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:54:46 -07:00

strings: add examples for specialCase

Change-Id: Ifa0384722dd879af7f5edb7b7aaac5ede3cff46d
Reviewed-on: https://go-review.googlesource.com/74690
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Ramazan AYYILDIZ 2017-10-31 11:19:48 +01:00 committed by Ian Lance Taylor
parent 52cf91a5d5
commit bc98cea941

View File

@ -249,6 +249,12 @@ func ExampleToTitle() {
// ХЛЕБ // ХЛЕБ
} }
func ExampleToTitleSpecial() {
fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "dünyanın ilk borsa yapısı Aizonai kabul edilir"))
// Output:
// DÜNYANIN İLK BORSA YAPISI AİZONAİ KABUL EDİLİR
}
func ExampleMap() { func ExampleMap() {
rot13 := func(r rune) rune { rot13 := func(r rune) rune {
switch { switch {
@ -274,11 +280,21 @@ func ExampleToUpper() {
// Output: GOPHER // Output: GOPHER
} }
func ExampleToUpperSpecial() {
fmt.Println(strings.ToUpperSpecial(unicode.TurkishCase, "örnek iş"))
// Output: ÖRNEK İŞ
}
func ExampleToLower() { func ExampleToLower() {
fmt.Println(strings.ToLower("Gopher")) fmt.Println(strings.ToLower("Gopher"))
// Output: gopher // Output: gopher
} }
func ExampleToLowerSpecial() {
fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Önnek İş"))
// Output: önnek iş
}
func ExampleTrim() { func ExampleTrim() {
fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡")) fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡"))
// Output: Hello, Gophers // Output: Hello, Gophers