Working With Strings

2024-04-17

We have read

work with strings

stringr cheatsheet

Homework 10

  • Use github classroom to accept the assignment
  • Don’t forget committing and pushing the changes!

Hints and Clarifications

  • Regular expressions are not necessary all the time

  • stringr functions are handy

  • str_view() vs str_view_all()

  • Step 3: Any time you see the word “ugh”, with any number of h’s, followed by a punctuation mark, delete this.

    • ugh, ugh! ughh! ughhhh should be deleted
  • Step 4: Replace all instances of exactly 2 a’s with exactly 2 e’s.

    • “baa” –> “bee” but nothing should happen to “baaa”
  • Step 6 Every word that ends in b, change that to a y. Hint: punctuation!

    • either “b!” or “b” is changed to y, no need to keep punctuation
  • By the end of step 7, you should see individual words that make sense.