Is there any fast way in JavaScript to find out if 2 Strings contain the same substring? e.g. I have these 2 Strings: "audi is a car" and "audiA8".
As you see the word "audi" is in both strings but we cannot find it out with a simple indexOf or RegExp, because of other characters in both strings.
Take a look at the similar text function implementation here. It returns the number of matching chars in both strings.
For your example it would be:
which means that strings have 4-char common substring.