Add deleteSubString function