-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Description
str_wrap sometimes inserts newlines at unwanted positions. The underlying function stringi::stri_wrap provides an option whitespace_only to force it to wrap only at whitespace. Exposing this option in the interface to str_wrap would provide an easy way to avoid this in many cases.
Reprex
library(stringr)
cat(str_wrap("weighted time spent doing I/Os (ms)", width = 14))
#> weighted time
#> spent doing I/
#> Os (ms)
# expected output:
cat(stringi::stri_wrap("weighted time spent doing I/Os (ms)", width = 14,
simplify = FALSE, whitespace_only = TRUE) %>%
vapply(., str_c, collapse = "\n", character(1))
)
#> weighted time
#> spent doing
#> I/Os (ms)Created on 2020-04-10 by the reprex package (v0.3.0)
francisbarton
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement