str_trunc: Truncate Strings

View source: R/str_trunc.R

str_truncR Documentation

Truncate Strings

Description

str_trunc() truncates a string to a given width.

Usage

str_trunc(str, width = 0.9 * getOption("width"), ellipsis = "[...]")

Arguments

str

(character())
Vector of strings.

width

(integer(1))
Width of the output.

ellipsis

(character(1))
If the string has to be shortened, this is signaled by appending ellipsis to str. Default is "[...]".

Value

(character()).

Examples

str_trunc("This is a quite long string", 20)

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.