Removes substring p