I am trying to split a string by the last occurrence of a separator (/) in golang
Example, I have a string "a/b/c/d", after performing the split, I would like an array of string as below
[
"a/b/c",
"a/b"
"a"
]
I tried exploring strings package but couldn't find any function that does this
func main() {
fmt.Printf("%q\n", strings.Split("a/b/c/d/e", "/"))
}
May I know a way to handle this?