I\'ve got 2 vectors:
word1 <- \"bestelling\" word2 <- \"bestelbon\"
Now I want to find the largest common substring that starts at the
A bit of regex can do this:
sub('^([^|]*)[^|]*(?:\\|\\1[^|]*)$', '\\1', paste0(word1, '|', word2)) #[1] "bestel"
I used | as a separator - pick one that makes sense for your strings.
|