split

func split<S : Sliceable, R : BooleanType>(_: S, maxSplit: Int, allowEmptySlices: Bool, #isSeparator: @noescape (S.Generator.Element) -> R)

Return the result of slicing elements into sub-sequences that don't contain elements satisfying the predicate isSeparator.

maxSplit the maximum number of slices to return, minus 1. If maxSplit + 1 slices would otherwise be returned, the algorithm stops splitting and returns a suffix of elements

allowEmptySlices if true, an empty slice is produced in the result for each pair of consecutive

Declaration

func split<S : Sliceable, R : BooleanType>(elements: S, maxSplit: Int = default, allowEmptySlices: Bool = default, #isSeparator: @noescape (S.Generator.Element) -> R) -> [S.SubSlice]