# replace

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/list/function-replace/

**function** · [`ferroui-dynamic-data`](/docs/0.5.0/api/ferroui-dynamic-data/) · v0.5.0

```rust
fn replace<T: Clone + PartialEq>(target: &mut dyn IList<T>, original: &T, replace_with: T)
```

Replaces `original` with `replace_with` (`ListEx.Replace`).
## Panics
When `original` is not in the list (`ArgumentException`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/list/i_list.rs#L273)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
