Instance Method


Returns a new data buffer created by removing the given number of bytes from the front of the original buffer.


func advanced(by amount: Int) -> Data



The number of bytes to strip from the input data buffer. The value must be less than the original data buffer's length.

Return Value

A newly created data buffer that is shorter by the given amount than the original.

See Also

Excluding Bytes

func dropLast(Int) -> Data

Returns a subsequence containing all but the specified number of final elements.

func dropFirst(Int) -> Data

Returns a subsequence containing all but the given number of initial elements.

func drop(while: (UInt8) -> Bool) -> Data

Returns a subsequence by skipping elements while predicate returns true and returning the remaining elements.

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