shorten: Shorten Strings to a Maximum Length

View source: R/string.R

shortenR Documentation

Shorten Strings to a Maximum Length

Description

Shorten Strings to a Maximum Length

Usage

shorten(x, max_chars = 10, delimiter = "...")

Arguments

x

vector of character

max_chars

maximum number of characters to which the strings in x are to be shortened

delimiter

string to be used as separater between the start and the end of the strings in x that are longer than max_chars characters

Value

x with strings longer than max_chars characters being shortend by replacing characters in the centre by the delimiter string.


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.