vendredi 24 mars 2023

Extract n characters after pattern in string in R

I have a long string with mupltiple instances of pattern. I want the n characters following the pattern. Say that my string is "quick fox jumps over the lazy dog" and I want the two characters after every "u". i.e. I would want a vector c("ic", "mp") as my output. How can I do this?

Thanks!

Aucun commentaire:

Enregistrer un commentaire