# task 1: get only names of countries that end with "A" or "a"
# note that the search in case-insensitive
countryEndsWith("A", full.list = FALSE)
# task 2: get only names of countries that end with "No" or "no"
countryEndsWith("no", full.list = FALSE)
# task 3: repeat task 2, but return full list for each country
countryEndsWith("no")
Run the code above in your browser using DataLab