Let's just say I have two strings, a & b.
var a = '[email protected]';
var b = 'yahoo12345556';
What I am expecting is result would be yahoo but using a.indexOf(b) would give me -1.
If I change b to yahoo & do a.indexOf(b), it obviously wouldn't give me -1.
Should I match characters in a loop instead? But the two strings aren't of equal length. It's also important that the characters should be in sequence, I am not looking for occurrence of characters.