Overprinting the previous value does, of course, involve knowing it but I hope that your code does that already so that values are only printed when they change
Bebbington once posted re-printing the old text using the background color for the text color, then print the new data in the appropriate color. That may be the fastest 'erase'.
Using the following format for setTextColor() may make these processes unnecessary.
However, if the string to be overwritten becomes shorter, the characters before the overwrite will remain, so you will need to use a formatted string or add spaces to the end.
Although it is not a perfect example, please refer to the following example:
Yes, I did and that is still my preferred option. I'm not the originator of the idea though, I read it somewhere, here I imagine, but I don't have a clue where or who from.