String is ex=\"test1, test2, test3, test4, test5\"
ex=\"test1, test2, test3, test4, test5\"
when I use
ex.split(\",\").first
it returns
\"test1\"
Try this:
first, *rest = ex.split(/, /)
Now first will be the first value, rest will be the rest of the array.
first
rest