- sub
- gsub
Substitute
- gsub is the global substituted or /g in other languages.
examples/regexes/substitute.cr
text = "ab text. and $ and ^ also" puts text puts text.sub(/\W/, "") puts text.gsub(/\W/, "")
ab text. and $ and ^ also ab text. and $ and ^ also abtextandandalso