1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:57:57 -07:00

strings: add Bernardo O'Higgins example

R=r, bradfitz
CC=golang-dev, rogpeppe
https://golang.org/cl/5673049
This commit is contained in:
Andrew Gerrand 2012-02-15 13:38:28 +11:00
parent 932cdfbc4c
commit d6a3650ad7

View 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"]