# New replace(s, pat =\> f) in functiion How to use?

**URL:** <https://discourse.julialang.org/t/new-replace-s-pat-f-in-functiion-how-to-use/16042>\
**Category:** General Usage\
**Created:** [October 8, 2018, 7:24pm UTC](https://discourse.julialang.org/t/new-replace-s-pat-f-in-functiion-how-to-use/16042 "2018-10-08T19:24:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [October 8, 2018, 7:24pm UTC](https://discourse.julialang.org/t/new-replace-s-pat-f-in-functiion-how-to-use/16042/1 "2018-10-08T19:24:24Z")

</div>

No idea ho to cheng old function to new , some help ?  
‘’’ for i =1:k  
…  
only=map(e-\>replace(string(e), i, “”), only)  
…  
end  
┌ Warning: `replace(s::AbstractString, pat, f)` is deprecated, use `replace(s, pat => f)` instead.  
│ caller = #11 at REPL[45]:6 [inlined]  
└ @ Core .\REPL[45]:  
‘’’  
Paul

---

<div class="post-metadata">

**Author:** ![bennedich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bennedich/32/4894_2.png) [@bennedich](https://discourse.julialang.org/u/bennedich)\
**Post date:** [October 8, 2018, 7:31pm UTC](https://discourse.julialang.org/t/new-replace-s-pat-f-in-functiion-how-to-use/16042/2 "2018-10-08T19:31:15Z")

</div>

Try this:

```julia
only = map(e->replace(string(e), string(i) => ""), only)

```
