Find elements in a character array that contains a string Just use grep: grep('a', x, value=TRUE) [1] "aa" "ab" "ac"