![[Stable]](figures/lifecycle-stable.svg)
rm_caps()
removes the first and/or last element of a `character“ vector.
Usage
rm_caps(x, start = TRUE, end = TRUE)
Arguments
- x
A character
vector.
- start
A logical
flag indicating whether to remove
the first element of x
(Default: TRUE
).
- end
A logical
flag indicating whether to remove
the last element of x
(Default: TRUE
).
Examples
rm_caps(c("a", "b", "c"))
#> [1] "b"
#> [1] "b" # Expected
rm_caps(c("a", "b", "c"), start = FALSE)
#> [1] "a" "b"
#> [1] "a" "b" # Expected
rm_caps(c("a", "b", "c"), end = FALSE)
#> [1] "b" "c"
#> [1] "b" "c" # Expected