name := "Batman" age := 38 nameAndAge = fmt.Sprintf("%s %d", name, age)
In another function, I can access the variable
nameAndAge. Now I want to get back both the variables that I used in
Sprintf. One oblivious way that I can think about is to split it based on the separator and create the variable. I wanted to know if there's any function available for doing that?
var name string var age int // " " is the separator here fmt.ReverseSprintf(nameAndAge, " ", name, age)