Instance Method

subdata(in:)

Returns a new copy of the data in a specified range.

Declaration

func subdata(in range: Range<Data.Index>) -> Data

Parameters

range

The range to copy.

See Also

Splitting the Buffer

func split(maxSplits: Int, omittingEmptySubsequences: Bool, whereSeparator: (UInt8) -> Bool) -> [Data]

Returns the longest possible subsequences of the collection, in order, that don’t contain elements satisfying the given predicate.

func split(separator: UInt8, maxSplits: Int, omittingEmptySubsequences: Bool) -> [Data]

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