Removes segments. Positive values shave the first segments, negative shave the last segments. new_item = new_item.replace(".k.", ".key.") new_item = new_item.replace ...