I have to manipulate strings so that, we need to check if a string needs to be combined with another string. Need to use a library function for this.
Suppose, we have
S1. This is an apple
s2. apple is sweet
so, the combined line should be: This is an apple is sweet
s1. This is an apple
s2. e that I bought
Combined: This is an apple that I bought
I used nested for loops for this and it makes it too complicated. Is there a string library function that I can use?
I will have bunch of lines of sentences, and I need to combine them to form one sentence.
I need to combine lines that match the most, not just 2 lines that match.