string.break.line: Break a String into Many Lines at Newlines

Description Usage Arguments Value Author(s) See Also Examples

Description

Takes a string and breaks it into seperate substrings where there are newline characters.

Usage

1

Arguments

string

character vector to be separated into many lines.

Value

Returns a list that is the same length of as the string argument.

Each list element is a character vector.

Each character vectors elements are the split lines of the corresponding element in the string argument vector.

Author(s)

Charles Dupont

See Also

strsplit

Examples

1
2
3
4
a <- c('', 'this is a single line string',
       'This is a\nmulti-line string.')

b <- string.break.line(a)

Example output

Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units

Hmisc documentation built on Oct. 7, 2021, 9:16 a.m.