isSubstring which checks whether one word is a substring of another