mirror of
https://github.com/golang/go
synced 2024-11-23 06:20:07 -07:00
strings: use own function for ReplaceAll example
This commit is contained in:
parent
9a11b73635
commit
b70745717a
@ -199,9 +199,13 @@ func ExampleRepeat() {
|
||||
|
||||
func ExampleReplace() {
|
||||
fmt.Println(strings.Replace("oink oink oink", "k", "ky", 2))
|
||||
fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo"))
|
||||
// Output:
|
||||
// oinky oinky oink
|
||||
}
|
||||
|
||||
func ExampleReplaceAll() {
|
||||
fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo"))
|
||||
// Output:
|
||||
// moo moo moo
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user