Skip to contents

Checks if a string ends with a newline character. If not, a newline character is appended.

Usage

withLineEnd(x)

Arguments

x

A string.

Value

The input string with a newline character at the end if it was not already present.

Examples

cat(withLineEnd("Hello"))
#> Hello