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/ggfacet documentation built on May 7, 2021, 11:40 a.m.