1
0
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:
dupoxy 2018-12-12 20:39:29 +01:00 committed by GitHub
parent 9a11b73635
commit b70745717a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}