R/string_wrap.R

Defines functions string_wrap

string_wrap <- function(str, width) {
  unlist(
    lapply(
      stringi::stri_wrap(str = str, width = width, simplify = F),
      FUN = function(wrapped_chr) paste0(wrapped_chr, collapse="\n")))
}

Try the saros package in your browser

Any scripts or data that you put into this service are public.

saros documentation built on June 8, 2025, 10:43 a.m.