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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software