Code to convert a string like "1-3,6,9" to [1,2,3,6,9]