如何从某个位置/某个偏移量开始跳过字符串中的子字符串的索引,例如:
package main
import (
"fmt"
"strings"
)
func main() {
string := "something.value=something=end"
index1 := strings.Index(string, "value=")
fmt.Println(index1) // prints 10
// index2 = ... How do I get the position of the second =, 25?
}
PHP 中的类似偏移量int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )
慕码人2483693
阿晨1998
相关分类