mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
04.8.md
This commit is contained in:
@@ -36,7 +36,7 @@ Example 4.13 [presuffix.go](examples/chapter_4/presuffix.go)
|
||||
|
||||
strings.Contains(s, substr string) bool
|
||||
|
||||
##4.7.3 判断子字符串或字符在父字符串中出现的位置(索引):
|
||||
##4.7.3 判断子字符串或字符在父字符串中出现的位置(索引)
|
||||
`Index` 返回字符串 `str` 在字符串 `s` 中的索引(`str` 的第一个字符的索引),-1 表示字符串 `s` 不包含字符串 `str`:
|
||||
|
||||
strings.Index(s, str string) int
|
||||
|
Reference in New Issue
Block a user