xxxxxxxxxx
val strs = "name, 2012, 2017".split(",").toTypedArray()
xxxxxxxxxx
// string that you want to split
val stringToSplit = "a string to split by spaces"
// split the string
val split = stringToSplit.split(" ")
// Results:
split[0] // a
split[1] // string
split[2] // to
split[3] // split
split[4] // by
split[5] // spaces