That’s the method for an array. You can’t do that in a string (and it turns out, making a vector of substitution pairs won’t help):
gustaphe
4
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Replace two substrings in a string with the same `replace` call? | 2 | 356 | October 20, 2021 | |
| Perform multiple replacements on a string in a single pass | 19 | 10026 | January 18, 2022 | |
| Replacing multiple strings errors | 11 | 4639 | March 13, 2019 | |
| Why isn't string replace variadic? | 1 | 284 | May 28, 2021 | |
| Replace behaving strange? | 6 | 856 | May 31, 2019 |