//取中间字符串

func Between(str, starting, ending string) string {

s := strings.Index(str, starting)

if s < 0 {

return ""

}

s += len(starting)

e := strings.Index(str[s:], ending)

if e < 0 {

return ""

}

return str[s : s+e]

}
(支付宝)给作者钱财以资鼓励 (微信)→
标签: Golang2  中间2  字符串21