Introduction
Use sub and gsub to replace parts of text in strings. They help fix or change words easily.
Fix a typo in a sentence by changing the first wrong word.
Replace all spaces in a text with underscores for file names.
Change all occurrences of a word in a paragraph to another word.
Remove unwanted characters from a string, like punctuation.
Update a date format by replacing slashes with dashes.