Commit 9c5eadf4 authored by Pablo Santiago Blum de Aguiar's avatar Pablo Santiago Blum de Aguiar Committed by Ian Lance Taylor

strings: add example for IndexByte

Change-Id: Ib6a59735381ce744553f1ac96eeb65a194c8da10
Reviewed-on: https://go-review.googlesource.com/48860Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a83d0175
......@@ -119,6 +119,15 @@ func ExampleIndexAny() {
// -1
}
func ExampleIndexByte() {
fmt.Println(strings.IndexByte("golang", 'g'))
fmt.Println(strings.IndexByte("gophers", 'h'))
fmt.Println(strings.IndexByte("golang", 'x'))
// Output:
// 0
// 3
// -1
}
func ExampleIndexRune() {
fmt.Println(strings.IndexRune("chicken", 'k'))
fmt.Println(strings.IndexRune("chicken", 'd'))
......
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