Skip to contents

Trims the input string to the desired length, appending an ellipsis to the end, without splitting in the middle of a word.

Usage

tr_trunc_neatly(x, l = 60)

Arguments

x

Input string to trim to desired length, appending an ellipsis to the end, and without splitting words

l

Desired length at which to trim strings (defaults to 60)

Value

Character string

References

None.

Examples

tr_trunc_neatly("This is a test string", l = 17)
#> [1] "This is a test..."