]> Cypherpunks repositories - gostls13.git/commitdiff
strings: add Bernardo O'Higgins example
authorAndrew Gerrand <adg@golang.org>
Wed, 15 Feb 2012 02:38:28 +0000 (13:38 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 15 Feb 2012 02:38:28 +0000 (13:38 +1100)
R=r, bradfitz
CC=golang-dev, rogpeppe
https://golang.org/cl/5673049

src/pkg/strings/example_test.go

index 7aca82d6324f94ff64f8bd07776cb6062889fd76..5ef0b93d15e5d6ef9b3fc3c8a8707ac15d95b5d0 100644 (file)
@@ -93,10 +93,12 @@ func ExampleReplace() {
 // ["a" "b" "c"]
 // ["" "man " "plan " "canal panama"]
 // [" " "x" "y" "z" " "]
+// [""]
 func ExampleSplit() {
        fmt.Printf("%q\n", strings.Split("a,b,c", ","))
        fmt.Printf("%q\n", strings.Split("a man a plan a canal panama", "a "))
        fmt.Printf("%q\n", strings.Split(" xyz ", ""))
+       fmt.Printf("%q\n", strings.Split("", "Bernardo O'Higgins"))
 }
 
 // ["a" "b,c"]