R/str_prepend.R

Defines functions str_prepend

Documented in str_prepend

#' Append a string to another
#'
#' @param x A character vector
#' @param string A character string to prepend
#' @param sep Optional separator string
#'
#' @return A character vector
#'
#' @export

str_prepend <- function(x, string, sep = "") {

  stringr::str_replace(x, "^", paste0(string, sep))

}
rscherrer/ggsim documentation built on June 11, 2020, 2:22 p.m.