Learn R Programming

pystr (version 2.0.0)

pystr_splitlines: Split a string at linebreaks.

Description

Return a list of the lines in the string, breaking at line boundaries.

Usage

pystr_splitlines(str, keepends = FALSE)

Arguments

str
A character vector.
keepends
A logical vector.

Value

A list of character vectors.

Details

Line breaks are not included in the resulting list unless keepends is TRUE. Line breaks include "\n", "\r", and "\r\n".

References

https://docs.python.org/3/library/stdtypes.html#str.splitlines

See Also

pystr_split

Examples

Run this code
pystr_splitlines("First\nSecond\rThird\r\n")
pystr_splitlines("First\nSecond\rThird\r\n", TRUE)

Run the code above in your browser using DataLab