powered by
Shortens strings to a given length.
clipString(x, len, tail = "...")
[character(1)].
character(1)
[character] Vector of strings.
character
[integer(1)] Absolute length the string should be clipped to, including tail. Note that you cannot clip to a shorter length than tail.
integer(1)
tail
[character(1)] If the string has to be shortened at least 1 character, the final characters will be tail. Default is “...”.
print(clipString("abcdef", 10)) print(clipString("abcdef", 5))
Run the code above in your browser using DataLab