Commit 09da2801 authored by dupoxy's avatar dupoxy Committed by Brad Fitzpatrick

strings: add ReplaceAll example

Change-Id: I6b0d470bdedb92844943c8e5823e214d6a7471cf
GitHub-Last-Rev: 4a135000ba9c23a588b960e5b2989710cc71e3e2
GitHub-Pull-Request: golang/go#29199
Reviewed-on: https://go-review.googlesource.com/c/153840Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e123ccbf
......@@ -205,6 +205,12 @@ func ExampleReplace() {
// moo moo moo
}
func ExampleReplaceAll() {
fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo"))
// Output:
// moo moo moo
}
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 "))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment