I've seen this SO question (How to return an subset of Array of characters?) but the problem is it is only dealing with a one-off return of the first characters of a string.
I'm trying to achieve something different but am not sufficiently familiar with the Swift language to know what functionality I need.
My problem is as follows, I've got an array:
["10", "44", "33", "31", "38", "49", "8", "4", "40"]
What would be the "Swift 4.2" way to return, for example, groups of three, i.e. :
["10", "44", "33"]
["31", "38", "49"]
["8", "4", "40"]
Also bear in mind the array may not always be exactly divisible (e.g. the above example array could easily have 10 values not 9) , so I would need to ignore any "excess" numbers at the end of the array.