<!--
{
  "availability" : [
    "iOS: 12.2.0 -",
    "iPadOS: 12.2.0 -",
    "macCatalyst: 12.2.0 -",
    "macOS: 10.14.4 -",
    "tvOS: 12.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/RawSpan/extracting(droppingFirst:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s7RawSpanV10extracting13droppingFirstABSi_tF"
  },
  "title" : "extracting(droppingFirst:)"
}
-->

# extracting(droppingFirst:)

Returns a span over all but the given number of initial bytes.

```
func extracting(droppingFirst k: Int) -> RawSpan
```

## Parameters

`k`

The number of bytes to drop from the beginning of
the span. `k` must be greater than or equal to zero.

## Return Value

A span starting after the specified number of bytes.

## Discussion

If the number of bytes to drop exceeds the number of bytes in
the span, the result is an empty span.

The returned span’s first byte is always at offset 0; unlike buffer
slices, extracted spans do not share their indices with the
span from which they are extracted.

> Complexity: O(1)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)