# Why no mutating filter function for strings?

**URL:** https://discourse.julialang.org/t/why-no-mutating-filter-function-for-strings/50213
**Category:** General Usage
**Tags:** question
**Created:** [November 16, 2020, 6:11am UTC](https://discourse.julialang.org/t/why-no-mutating-filter-function-for-strings/50213 "2020-11-16T06:11:59Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [November 16, 2020, 6:16am UTC](https://discourse.julialang.org/t/why-no-mutating-filter-function-for-strings/50213/2 "2020-11-16T06:16:02Z")

</div>

This is probably because strings are immutable. Methods with `!` work by modifying the container passed to them, but you can’t modify a string in Julia (for performance reasons).

---

_[View the full topic](https://discourse.julialang.org/t/why-no-mutating-filter-function-for-strings/50213)._
