# Why isn't string replace variadic?

**URL:** https://discourse.julialang.org/t/why-isnt-string-replace-variadic/62020
**Category:** General Usage
**Created:** [May 28, 2021, 9:01pm UTC](https://discourse.julialang.org/t/why-isnt-string-replace-variadic/62020 "2021-05-28T21:01:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)
#### Post date: [May 28, 2021, 9:01pm UTC](https://discourse.julialang.org/t/why-isnt-string-replace-variadic/62020/1 "2021-05-28T21:01:34Z")

</div>

```julia
replace(s::AbstractString, pat=>r; [count::Integer])

```

[https://docs.julialang.org/en/v1/base/strings/#Base.replace-Tuple{AbstractString,%20Pair}](https://docs.julialang.org/en/v1/base/strings/#Base.replace-Tuple%7BAbstractString,%20Pair%7D)

If I want to make two replacements in one pass I have to use regex? It seems like I should be able to do

```julia
replace("hello world", "hello" => "hi", "world" => "julia")

```

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [May 28, 2021, 9:09pm UTC](https://discourse.julialang.org/t/why-isnt-string-replace-variadic/62020/2 "2021-05-28T21:09:51Z")

</div>

See [`replace` does not handle multiple patterns for String · Issue #35327 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/35327) and [implement replace on String for multiple patterns by vtjnash · Pull Request #40484 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/40484).
