---
title: "extracting(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/rawspan/extracting(_:)-2imhy"
---

# extracting(_:)

Constructs a new span over the bytes within the supplied range of positions within this span.

## Declaration

```swift
func extracting(_ bounds: Range<Int>) -> RawSpan
```

## Parameters

- `bounds`: A valid range of positions. Every position in this range must be within the bounds of this RawSpan.

## Return Value

Return Value A span over the bytes within bounds

## Discussion

Discussion 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. note: O(1)
