Use the `inreplace` function for this.