powered by
Extension of strsplit(). Makes it possible to split lines before or after a pattern match without removing the pattern.
strsplit2(x, split, type = "remove", perl = FALSE)
A list of the same length as x, the i-th element of which contains the vector of splits of x[i].
text string to process.
pattern to split text at.
one out of c("remove", "before", "after").
Logical. If TRUE uses perl expressions.
x<-"This is some text, where text is the split pattern of the text." strsplit2(x,"text","after")
Run the code above in your browser using DataLab