stringr
stringr copied to clipboard
SQL's LIKE is actually case sensitive
So need to change the default, and update the docs.
Probably worth a little exploration of impact on users (with github search for str_like()
).
@hadley I wonder whether instead of changing the default of ignore_case, what about introducing a new function: str_ilike()
?
Then stringr could have two functions
- str_like - similar to SQL LIKE that is case sensitive
- str_ilike - similar to SQL ILIKE that is case insensitive
I suppose the benefit of this would be that these would more directly align with SQL concepts. But the drawback would be this would be a bigger change (although perhaps a less subtle breaking change than simply switching the default)
Yeah, I think that's a good idea. Then we can just deprecate the ignore_case
argument.
OTOH it's not very consistent with how other stringr handle case. But I think it's justifiable in this case because it's so closely related to mimicing SQL.
@hadley I have opened pr #544 with a str_ilike function and the ignore_case argument in str_like deprecated
Thanks, I'll take a look when I'm next working on stringr.