powered by
strs_splitlines splits each element of a character vector into separate lines. It is similar to Python's str.splitlines() method.
strs_splitlines
str.splitlines()
strs_splitlines(string, keepends = FALSE)
A list of character vectors, with each vector containing lines from the corresponding element of string.
string
A character vector to be split into lines.
A boolean indicating whether to retain line end characters.
Python str.splitlines() documentation
strs_splitlines("hello\nworld\n") strs_splitlines("line1\r\nline2\n", keepends = TRUE)
Run the code above in your browser using DataLab