Can you please demonstrate an efficient way to use strings.split
such that empty tokens are not included in the returned slice?
Specifically, the following code returns ["a" "" "b" "c"]
where I want to have it return ["a" "b" "c"]
:
fmt.Printf("%q
", strings.Split("a,,b,c", ","))