28-implement-strstr
需找第一次出现字符串的下表
解体思路
直接用切片判断下就好了
go解法
1 | func strStr(haystack string, needle string) int { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
直接用切片判断下就好了
1 | func strStr(haystack string, needle string) int { |