Split a string at linebreaks.

Share:

Description

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

Usage

1
pystr_splitlines(str, keepends = FALSE)

Arguments

str

A character vector.

keepends

A logical vector.

Details

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

Value

A list of character vectors.

References

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

See Also

pystr_split

Examples

1
2
pystr_splitlines("First\nSecond\rThird\r\n")
pystr_splitlines("First\nSecond\rThird\r\n", TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.