diff --git a/strings.qmd b/strings.qmd index bca44d1..3b54183 100644 --- a/strings.qmd +++ b/strings.qmd @@ -405,7 +405,7 @@ There are three ways we could fix this: - Add the upper case vowels to the character class: `str_count(name, "[aeiouAEIOU]")`. - Tell the regular expression to ignore case: `str_count(regex(name, ignore.case = TRUE), "[aeiou]")`. We'll talk about this next. -- Use `str_lower()` to convert the names to lower case: `str_count(to_lower(name), "[aeiou]")`. We'll come back to this function in @sec-other-languages. +- Use `str_to_lower()` to convert the names to lower case: `str_count(str_to_lower(name), "[aeiou]")`. We'll come back to this function in @sec-other-languages. This is pretty typical when working with strings --- there are often multiple ways to reach your goal, either making your pattern more complicated or by doing some preprocessing on your string. If you get stuck trying one approach, it can often be useful to switch gears and tackle the problem from a different perspective.