golang中的字符串操作strings.IndexRune
package main
import (
"fmt"
"strings"
)
//golang字符串操作
func main(){
s := "hello world hello world"
//str := "wo"
//返回字符r在字符串s中第一次出现的位置。如果找不到则返回-1。
index := strings.IndexRune(s,'e')
fmt.Println(index) //1
}