---
title: "replacing(with:where:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/simdmask/replacing(with:where:)-7q8n5"
---

# replacing(with:where:)

Returns a copy of this vector, with elements replaced by elements of other in the lanes where mask is true.

## Declaration

```swift
func replacing(with other: SIMDMask<Storage>, where mask: SIMDMask<Storage>) -> SIMDMask<Storage>
```

## Discussion

Discussion Equivalent to: var result = Self() for i in indices {   result[i] = mask[i] ? other[i] : self[i] }
