PHP » GoLang |
login |
register |
about
|
strstrstrstr[code]
func Strstr(haystack string, needle string) string {
if needle == "" {
return ""
}
idx := strings.Index(haystack, needle)
if idx == -1 {
return ""
}
return haystack[idx+len([]byte(needle))-1:]
}
[/code]
|