R/stringutilities.R

Defines functions str_remove_all str_extract_all

# string utilities. This is mainly here to avoid a dependency on stringr

str_extract_all <- function(string, pattern) {
  regmatches(string, gregexpr(pattern, string, perl = TRUE))
}

str_remove_all <- function(string, toRemove) {
  gsub(toRemove, "", string, fixed = TRUE)
}
vandenman/JASPgraphs documentation built on Dec. 16, 2021, 5:37 p.m.