This is a common task I'm facing: splitting a space separated list into a head element and an array containing the tail elements. For example, given this string:
the quick brown fox
We want:
"the"
["quick","brown","fox"]
.. in two different variables. The first variable should be a string, and the second an array. I'm looking for an elegant way to do this (preferably in Java).