Hi, I have a string

"InTrouble"

and want to extract, say, the first two characters: "In"
or the last three: "blee"
or the 3rd, 4th, and 5th: "Trou"

Is there an easy way of doing this quickly with regular expressions in gsub, 
grep or similar?

Thank you for any help.

Gonçalo

______________________________________________
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