implement isSubstring