home‎ > ‎go‎ > ‎

One Line Tokenizer

I liked the one liner in go, by FB programmer, Gaurav

func tokenize(exp string) []string {
return strings.Fields(
strings.Replace(strings.Replace(exp, "(", " ( ", -1), ")", " ) ", -1),
)
}

Here is the source code.
Comments