Multi-String Replace in Golang with Replacer
Published in
3 min readJun 23, 2022
String replacements in Golang are very easy using the strings
package. From their docs: “Package strings implements simple functions to manipulate UTF-8 encoded strings”. Take the following sentence:
"Hello World!"
Now let’s say my product owner thinks saying “Hello World” with an exclamation mark is just too much, and if I find that I need to replace the !
with…