Examples for 'stringr::str_trunc'


Truncate a string to maximum width

Aliases: str_trunc

Keywords:

### ** Examples

x <- "This string is moderately long"
rbind(
  str_trunc(x, 20, "right"),
  str_trunc(x, 20, "left"),
  str_trunc(x, 20, "center")
)
     [,1]                  
[1,] "This string is mo..."
[2,] "...s moderately long"
[3,] "This stri...ely long"

[Package stringr version 1.5.1 Index]