Skip to contents

[Stable]

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).

Value

A character vector.

See also

Other vector functions: cutter(), split_by_pattern()

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