Longest common prefix/suffix
trim_common_affixes(x, .x = NULL, na.rm = TRUE, prefixes = TRUE, suffixes = TRUE, warn_if_no_prefix = TRUE, warn_if_no_suffix = TRUE) longest_suffix(x, .x = NULL, na.rm = TRUE, warn_if_no_suffix = TRUE) longest_prefix(x, .x = NULL, na.rm = TRUE, warn_if_no_prefix = TRUE)
| x | A character vector. |
|---|---|
| .x | If |
| na.rm | (logical, default: If |
| prefixes | (logical, default: |
| suffixes | (logical, default: |
| warn_if_no_prefix, warn_if_no_suffix | (logical, default: |
The longest common substring in x either at the start or end of each string.
For trim_common_affixes x with common prefix and common suffix
removed.
#> [1] "total"#> [1] "total"