---
title: "replaceSubrange(_:with:count:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/data/replacesubrange(_:with:count:)"
---

# replaceSubrange(_:with:count:)

Replaces a region of bytes in the data with bytes from memory.

## Declaration

```swift
mutating func replaceSubrange(_ subrange: Range<Data.Index>, with bytes: UnsafeRawPointer, count cnt: Int)
```

## See Also

### Replacing a Range of Bytes

- [replaceSubrange(_:with:)](foundation/data/replacesubrange(_:with:)-9u7ry.md)
- [replaceSubrange(_:with:)](foundation/data/replacesubrange(_:with:)-9nzh.md)
