---
title: "replacing(with:where:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/simd64/replacing(with:where:)-3ecx2"
---

# 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: Self, where mask: SIMDMask<Self.MaskStorage>) -> Self
```

## Discussion

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