Remove extraneous lead/trail characters