Hi all,

Does anyone have a version of strsplit that keeps the string that is
split by.  e.g. from
x <- "A: 123 B: 456 C: 678"

I'd like to get

c("A:", "123 ", "B: ", "456 ", "C: ", 678)

but
strsplit(x, "[A-Z]+:")

gives me
c("", " 123 ", " 456 ", " 678")

Any ideas?

Thanks,

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to