aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/bytes/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/bytes/example_test.go')
-rw-r--r--libgo/go/bytes/example_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/libgo/go/bytes/example_test.go b/libgo/go/bytes/example_test.go
index 6d32837..5ba7077 100644
--- a/libgo/go/bytes/example_test.go
+++ b/libgo/go/bytes/example_test.go
@@ -365,6 +365,16 @@ func ExampleToTitle() {
// ХЛЕБ
}
+func ExampleToTitleSpecial() {
+ str := []byte("ahoj vývojári golang")
+ totitle := bytes.ToTitleSpecial(unicode.AzeriCase, str)
+ fmt.Println("Original : " + string(str))
+ fmt.Println("ToTitle : " + string(totitle))
+ // Output:
+ // Original : ahoj vývojári golang
+ // ToTitle : AHOJ VÝVOJÁRİ GOLANG
+}
+
func ExampleTrim() {
fmt.Printf("[%q]", bytes.Trim([]byte(" !!! Achtung! Achtung! !!! "), "! "))
// Output: ["Achtung! Achtung"]
@@ -438,11 +448,31 @@ func ExampleToUpper() {
// Output: GOPHER
}
+func ExampleToUpperSpecial() {
+ str := []byte("ahoj vývojári golang")
+ totitle := bytes.ToUpperSpecial(unicode.AzeriCase, str)
+ fmt.Println("Original : " + string(str))
+ fmt.Println("ToUpper : " + string(totitle))
+ // Output:
+ // Original : ahoj vývojári golang
+ // ToUpper : AHOJ VÝVOJÁRİ GOLANG
+}
+
func ExampleToLower() {
fmt.Printf("%s", bytes.ToLower([]byte("Gopher")))
// Output: gopher
}
+func ExampleToLowerSpecial() {
+ str := []byte("AHOJ VÝVOJÁRİ GOLANG")
+ totitle := bytes.ToLowerSpecial(unicode.AzeriCase, str)
+ fmt.Println("Original : " + string(str))
+ fmt.Println("ToLower : " + string(totitle))
+ // Output:
+ // Original : AHOJ VÝVOJÁRİ GOLANG
+ // ToLower : ahoj vývojári golang
+}
+
func ExampleReader_Len() {
fmt.Println(bytes.NewReader([]byte("Hi!")).Len())
fmt.Println(bytes.NewReader([]byte("こんにちは!")).Len())