Learn R Programming

catchr (version 0.2.31)

give_newline: Make a string end with a newline character

Description

give_newline will append a line return ('\n') to the end of a string if it doesn't already end with one. There is also the option to remove any trailing whitespace before doing so.

Usage

give_newline(s, trim = FALSE)

Arguments

s

A string.

trim

Indicates whether to remove trailing whitespace before adding newline.