Find index of a substring in a string, with start index specified
问题 I know there is strings.Index and strings.LastIndex , but they just find the first and last. Is there any function I can use, where I can specify the start index? Something like the last line in my example. Example: s := "go gopher, go" fmt.Println(strings.Index(s, "go")) // Position 0 fmt.Println(strings.LastIndex(s, "go")) // Postion 11 fmt.Println(strings.Index(s, "go", 1)) // Position 3 - Start looking for "go" begining at index 1 回答1: It's an annoying oversight, you have to create your