If a string contains a given pattern duplicated back-to-back a number of times, remove that duplication, leaving the pattern appearing once in that position (works if the pattern is duplicated in different parts of a string, removing all instances of duplication). This is vectorized over string and pattern.
str_singleize(string, pattern)
A character vector.
The pattern to look for.
The default interpretation is a regular expression, as described in stringi::about_search_regex.
To match a without regular expression (i.e. as a human would), use
coll(). For details see stringr::regex()
.
A character vector.
Other removers:
str_remove_quoted()
,
str_trim_anything()