You present a very artificial albeit simple example. In that case you could simply replace the whole line. What if it were a multiline value?