I have an array of strings in Swift that I want to shorten to only the first 5. It looks like I cannot do:
myArray = myArray[0..<5]
because I get a compiler error:
Cannot subscript a value of type [String] with an index of type Countable Range
So what can I do instead?