
Last chance! 50% off unlimited learning
Sale ends in
str_trunc()
truncates a string to a given width.
str_trunc(str, width = 0.9 * getOption("width"), ellipsis = "[...]")
(character()
).
(character()
)
Vector of strings.
(integer(1)
)
Width of the output.
(character(1)
)
If the string has to be shortened, this is signaled by appending ellipsis
to str
. Default is "[...]"
.
str_trunc("This is a quite long string", 20)
Run the code above in your browser using DataLab