# NOT RUN {
string <- c("Hello", "Helo", "Hole", "Apple", "Ape", "New", "Old", "System", "Systemic")
str_find(string, "hel") # partial match
str_find(string, "stem") # partial match
str_find(string, "R") # no match
str_find(string, "saste") # similarity to "System"
# finds two indices, because partial matching now
# also applies to "Systemic"
str_find(string,
"sytsme",
partial = 1)
# finds partial matching of similarity
str_find("We are Sex Pistols!", "postils")
# }
Run the code above in your browser using DataLab