clipString: Shortens strings to a given length.

View source: R/clipString.R

clipStringR Documentation

Shortens strings to a given length.

Description

Shortens strings to a given length.

Usage

clipString(x, len, tail = "...")

Arguments

x

[character]
Vector of strings.

len

[integer(1)]
Absolute length the string should be clipped to, including tail. Note that you cannot clip to a shorter length than tail.

tail

[character(1)]
If the string has to be shortened at least 1 character, the final characters will be tail. Default is “...”.

Value

[character(1)].

Examples

print(clipString("abcdef", 10))
print(clipString("abcdef", 5))

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.

Related to clipString in BBmisc...