Taking a set of filenames remove the constant leading &/or lagging portion of the names.

remove_constant_name(name_set)

Arguments

name_set

a character vector of names with some common leading or lagging substrings.

Value

name_set with constant substring removed.

Examples

remove_constant_name(c("xxxxsample1yyyy", "xxxxcontrol1yyyy"))
#> [1] "sample" "control"