# Add full stop if missing
text_fullstop(c("something", "something else."))
# Find last characters
text_lastchar(c("ABC", "DEF"), n = 2)
# Smart concatenation
text_concatenate(c("First", "Second", "Last"))
text_concatenate(c("First", "Second", "Last"), last = " or ", enclose = "`")
# Remove parts of string
text_remove(c("one!", "two", "three!"), "!")
# Wrap text
long_text <- paste(rep("abc ", 100), collapse = "")
cat(text_wrap(long_text, width = 50))
# Paste with optional separator
text_paste(c("A", "", "B"), c("42", "42", "42"))
Run the code above in your browser using DataLab