Description Usage Arguments Value Examples
Strip off the first and last characters of a string. If there are two distinct punctuation characters in the result, then the string is garbage. Stripping off the last two characters as false positives includes those ending with ').' and similar.
1 | rmg_has_two_distinct_puncts_inside(x, last_n = 2)
|
x |
a character vector |
last_n |
numeric, number of final characters to strip |
Logical
1 2 3 4 5 | garbage_string_2p1 <- "'hi!cou?cou,"
garbage_string_2p2 <- "jean-marc,"
rmg_has_two_distinct_puncts_inside(garbage_string_2p1) # TRUE
rmg_has_two_distinct_puncts_inside(garbage_string_2p2) # FALSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.