Returns the longest possible subsequences of the collection, in order, around elements equal to the given element.
- Xcode 7.1+
- Swift Standard Library
An array of subsequences, split from this collection’s elements.
The resulting array consists of at most
max subsequences. Elements that are used to split the collection are not returned as part of any subsequence.
The following examples show the effects of the
omitting parameters when splitting a string at each space character (” “). The first use of
split returns each word that was originally separated by one or more spaces.
The second example passes
1 for the
max parameter, so the original string is split just once, into two new strings.
The final example passes
false for the
omitting parameter, so the returned array contains empty strings where spaces were repeated.