]> Cypherpunks repositories - gostls13.git/commitdiff
strings: add examples for specialCase
authorRamazan AYYILDIZ <rayyildiz@gmail.com>
Tue, 31 Oct 2017 10:19:48 +0000 (11:19 +0100)
committerIan Lance Taylor <iant@golang.org>
Tue, 31 Oct 2017 14:09:07 +0000 (14:09 +0000)
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>
src/strings/example_test.go

index ba67458d1ff734bbac7358c30bfaa0e9dad15441..f7a78b4385d2835392d4ea3e494aefd0708166f6 100644 (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() {
        rot13 := func(r rune) rune {
                switch {
@@ -274,11 +280,21 @@ func ExampleToUpper() {
        // Output: GOPHER
 }
 
+func ExampleToUpperSpecial() {
+       fmt.Println(strings.ToUpperSpecial(unicode.TurkishCase, "örnek iş"))
+       // Output: ÖRNEK İŞ
+}
+
 func ExampleToLower() {
        fmt.Println(strings.ToLower("Gopher"))
        // Output: gopher
 }
 
+func ExampleToLowerSpecial() {
+       fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Önnek İş"))
+       // Output: önnek iş
+}
+
 func ExampleTrim() {
        fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡"))
        // Output: Hello, Gophers