gsub / subReplaces a part of the string.Syntaxtext.gsub(old, new)Descriptiongsub replaces all matches, sub replaces only the first one.ExampleLoading editor…▶ Try it yourselfExpected outputemma emmaWhen to use?Text cleaning, templating.Related commandssplit / joininclude? / index← strip / chompsplit / join →