Replace extension '.bk'
sub_bk(path, replacement = "", stop_if_not_ext = TRUE)
String with extension '.bk'.
Replacement of '.bk'. Default replaces by nothing.
If replacement != ""
, whether to error if
replacement is not an extension (i.e. starting with a dot).
String with extension '.bk' replaced by replacement
.
path <- "toto.bk"
sub_bk(path)
#> [1] "toto"
sub_bk(path, ".rds")
#> [1] "toto.rds"