mirror of https://github.com/golang/go.git
bytes: add ReplaceAll example
This commit is contained in:
parent
d1882c9866
commit
4ca6648eb6
|
|
@ -298,6 +298,12 @@ func ExampleReplace() {
|
|||
// moo moo moo
|
||||
}
|
||||
|
||||
func ExampleReplaceAll() {
|
||||
fmt.Printf("%s\n", bytes.ReplaceAll([]byte("oink oink oink"), []byte("oink"), []byte("moo"))
|
||||
// Output:
|
||||
// moo moo moo
|
||||
}
|
||||
|
||||
func ExampleRunes() {
|
||||
rs := bytes.Runes([]byte("go gopher"))
|
||||
for _, r := range rs {
|
||||
|
|
|
|||
Loading…
Reference in New Issue