golang判断字符串出现的位置及是否包含

判断子字符串或字符在父字符串中出现的位置(索引) Index 返回字符串 str 在字符串 s 中的索引( str 的第一个字符的索引),-1 表示字符串 s 不包含 字符串 str : strings.Index(s, str string) int LastIndex 返回字符串 str 在字符串 s 中最后出现位置的索引( str 的第一个字符的索引),-1 表示 字符串 s 不包含字符串
相关文章
相关标签/搜索