Collection
extension Collection
-
Declaration
Swift
public func subsets(cardinality k: Int) -> [[Element]]Return Value
All combinations of with a given
cardinality(i.e., how many elements chosen per combination). -
All of the permutations of each of the elements in each of the given sequences.
Declaration
Swift
public var permutations: [[Element]] { get } -
Declaration
Swift
public func split(at index: Index) -> (SubSequence, SubSequence)?Return Value
A two-tuple containing two arrays of
Elementssplit at the givenindex, if the givenindexis in the bounds ofself.Otherwise,nil. -
The elements to the left of the element at the given
indexThe element at the given
indexThe elements to the right of the element at the given
index
if the given
indexis in the bounds ofself.Otherwise,nil.Declaration
Swift
public func splitAndExtractElement(at index: Index) -> (SubSequence, Element, SubSequence)?Return Value
A three-tuple containing:
View on GitHub
Install in Dash
Collection Extension Reference