golang中的strings.LastIndexAny
生活随笔
收集整理的這篇文章主要介紹了
golang中的strings.LastIndexAny
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?golang中的字符串操作strings.LastIndexAny
package mainimport ("fmt""strings" )//golang字符串操作 func main(){s := "hello world hello world"str := "wo"//返回字符串str中的任何一個字符在字符串s中最后一次出現的位置。//如果找不到或str為空則返回-1index := strings.LastIndexAny(s,str)fmt.Println(index) //19 }?
總結
以上是生活随笔為你收集整理的golang中的strings.LastIndexAny的全部內容,希望文章能夠幫你解決所遇到的問題。