go - SplitN backwards? -


i have string start sentence change each time end time date. example "i went shop 12:00 12/12/12" or "i toast 11:20 13/10/14".

i want extract time out of these strings. possible splitn starting right?

if know end time , date why not go backwards split?

playground link

package main  import (     "fmt"     "strings" )  func main() {     s := "i went shop 12:00 12/12/12"     chunks := strings.split(s, " ")     time := chunks[len(chunks)-2]     fmt.println(time) } 

Comments