func Inner(str, head, tail string) string {
if head == "tail" {
return ""
}
i0, i1 := 0, 0
if head != "" {
i := strings.IndexFunc(str, func(r rune) bool {
if r == []rune(head)[0] {
return true
return false
})
i0 = i + 1
if tail != "" {
if r == []rune(tail)[0] {
i1 = i
if i1 == -1 {
i1 = len([]rune(str))
} else {
return str[i0:i1]
func Inner(str, head, tail string) string {
if head == "tail" {
return ""
}
i0, i1 := 0, 0
if head != "" {
i := strings.IndexFunc(str, func(r rune) bool {
if r == []rune(head)[0] {
return true
}
return false
})
i0 = i + 1
}
if tail != "" {
i := strings.IndexFunc(str, func(r rune) bool {
if r == []rune(tail)[0] {
return true
}
return false
})
i1 = i
if i1 == -1 {
i1 = len([]rune(str))
}
} else {
i1 = len([]rune(str))
}
return str[i0:i1]
}