my_names <- c('ondasabc\n123', 'ondassss') library(stringr) str_extract(my_names, 'ondas.*')
Standard input is empty
[1] "ondasabc" "ondassss"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!