update method of string