library(stringr)txt <- "bvwbjplbgvbhsrlpgdmjqwftvncz"str_extract(txt, "(.)(?!\\1)(.)(?!\\1|\\2)(.)(?!\\1|\\2|\\3)(.)")
Standard input is empty
[1] "vwbj"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!