Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Strings basics
Regular expressions
Modifying strings
Summary

Instruction

The grepl() function allows you to check for strings longer than the one-letter patterns we've seen so far. For example, if you want to find cities which have the word "City" in their name, you can run the following code:

cities[grepl("City", cities)]

Exercise

List all countries that have Republic in their name.

Stuck? Here's a hint!

Simply type:

countries[grepl("Republic", countries)]