Skip to content

string split at xth position

1 message · Keith Weintraub

#
Here is another way

require(stringr)

aaa<-paste0("a", 1:20)
bbb<-paste0("b", 101:120)
ab<-paste0(aaa,bbb)
ab


ptrn<-"([ab][[:digit:]]*)"
unlist(str_extract_all(ab, ptrn))
--