Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clipString

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

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.