Added containsSubstring helper method.