---
title: "replace(with:where:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/simdmask/replace(with:where:)-11sio"
---

# replace(with:where:)

Replaces elements of this vector with elements of other in the lanes where mask is true.

## Declaration

```swift
mutating func replace(with other: SIMDMask<Storage>, where mask: SIMDMask<Storage>)
```

## Discussion

Discussion Equivalent to: for i in indices {   if mask[i] { self[i] = other[i] } }
