---
title: "resetBytes(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/data/resetbytes(in:)"
---

# resetBytes(in:)

Sets a region of the data buffer to 0.

## Declaration

```swift
mutating func resetBytes(in range: Range<Data.Index>)
```

## Parameters

- `range`: The range in the data to set to 0.

## Discussion

Discussion If range exceeds the bounds of the data, then the data is resized to fit.

## See Also

### Creating Empty Data

- [init()](foundation/data/init().md)
- [init(capacity:)](foundation/data/init(capacity:).md)
- [init(count:)](foundation/data/init(count:).md)
