update start index in String p