mirror of
https://github.com/golang/go
synced 2024-11-21 23:34:42 -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:
parent
932cdfbc4c
commit
d6a3650ad7
@ -93,10 +93,12 @@ func ExampleReplace() {
|
|||||||
// ["a" "b" "c"]
|
// ["a" "b" "c"]
|
||||||
// ["" "man " "plan " "canal panama"]
|
// ["" "man " "plan " "canal panama"]
|
||||||
// [" " "x" "y" "z" " "]
|
// [" " "x" "y" "z" " "]
|
||||||
|
// [""]
|
||||||
func ExampleSplit() {
|
func ExampleSplit() {
|
||||||
fmt.Printf("%q\n", strings.Split("a,b,c", ","))
|
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("a man a plan a canal panama", "a "))
|
||||||
fmt.Printf("%q\n", strings.Split(" xyz ", ""))
|
fmt.Printf("%q\n", strings.Split(" xyz ", ""))
|
||||||
|
fmt.Printf("%q\n", strings.Split("", "Bernardo O'Higgins"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ["a" "b,c"]
|
// ["a" "b,c"]
|
||||||
|
Loading…
Reference in New Issue
Block a user