give_newline: Make a string end with a newline character

Description Usage Arguments

View source: R/catching-n-plans.R

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

1
give_newline(s, trim = FALSE)

Arguments

s

A string.

trim

Indicates whether to remove trailing whitespace before adding newline.


burchill/catchr documentation built on Jan. 9, 2020, 2:34 p.m.