How to clear a text before a new text is placed in some spot

Ideas for you to try

1 - print the text that you want to remove but do it in the background colour
or
2 - print spaces over the text that you want to get rid off but do it in the background colour

Once the previous text has gone, print the new text