How to compare two strings return common

Hi,

It seems algorithm matter. The activity uses major diff algorithm, and it judges cost of deleting all and inserting all is lower than leaving some words.
There are some online text comparison site and they return same result.

If you need to extract the above sentence, should use another algorithm…

So, I just wrote sample code. Hope the following helps you.

Sample20210519-1.zip (3.1 KB)

Regards,