split(separator:maxSplits:omittingEmptySubsequences:)

Returns the longest possible subsequences of the collection, in order, around elements equal to the given separator.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
func split<C>(separator: C, maxSplits: Int = .max, omittingEmptySubsequences: Bool = true) -> [Self.SubSequence] where C : Collection, Self.Element == C.Element

Parameters

separator

The element to be split upon.

Returns

A collection of subsequences, split from this collection’s elements.