Skip to contents

Truncate a string with ellipsis, if necessary

Usage

truncateString(x, n = 200L)

Arguments

x

character(1). Character string.

n

integer(1). Maximum number of characters. Function will truncate with "...", when applicable.

Value

character(1).

Note

Updated 2023-09-21.

See also

  • https://stackoverflow.com/questions/46759358/

Examples

truncateString("abcdefgi", n = 6L)
#> [1] "abc..."