Problem TFT LCD Text update

Hi.I am using Arduino TFT LCD screen 1.77" diagonal, 160 x 128 pixel resolution with micro-SD slot.Complete detail of the display is given in the below link.

I am trying to interface this with Arduino Micro Board.I have used the Example sketch from Arduino IDE to display the Text in the TFT screen.
(Arduino IDE->File->Example->TFT->Arduino->TFTDisplay Text)

This is my code.

#include <TFT.h>  // Arduino LCD library
#include <SPI.h>

// pin definition for the Uno
#define cs   10
#define dc   12
#define rst  1 
// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst);

// char array to print to the screen
char sensorPrintout[4];

void setup() {
  
  // Put this line at the beginning of every sketch that uses the GLCD:
  TFTscreen.begin();

  // clear the screen with a black background
  TFTscreen.background(0, 0, 0);
  
  // write the static text to the screen
  // set the font color to white
  TFTscreen.stroke(255,255,255);
  // set the font size
  TFTscreen.setTextSize(2);
  // write the text to the top left corner of the screen
  TFTscreen.text("Sensor Value :\n ",0,0);
  // ste the font size very large for the loop
  TFTscreen.setTextSize(5);
}

void loop() {

  // Read the value of the sensor on A0
  String sensorVal = String(analogRead(A0));
 
  // convert the reading to a char array
  sensorVal.toCharArray(sensorPrintout, 4);

  // set the font color
  TFTscreen.stroke(255,255,255);
  // print the sensor value
  TFTscreen.text(sensorPrintout, 0, 20);

//PROBLEM-START

  // wait for a moment
  delay(250);
  // erase the text you just wrote
  TFTscreen.stroke(0,0,0);
  TFTscreen.text(sensorPrintout, 0, 20);


//PROBLEM-END


}

If I remove the PROBLEM code,then I will get the sensor value without blinking.But if there is any changes in the Sensor value, the new value will overwrite on the Previous value and finally value is not visible in the display.I want to display the text without blink and new value should be update clearly.

Kindly help me to solve this problem.

Thanks in Advance.

If I remove the PROBLEM code,then I will get the sensor value without blinking.But if there is any changes in the Sensor value, the new value will overwrite on the Previous value and finally value is not visible in the display.I want to display the text without blink and new value should be update clearly.

To get rid of the old value, you need to erase the screen. But, you should ONLY do that (and redraw the text) if the value changes. To do that, you must keep track of the previous value written.

And GET RID OF THE STUPID String class.

Thank you for your reply.I am a beginner.Could you please guide me to write the code to solve the problem? Is there any examples available?

Could you please guide me to write the code to solve the problem?

No, I can't hold your hand. I can't imagine that you don't know how to copy the value in one variable to another. I can't imagine that you can't write an if statement to compare the current value to the previous value. I can't imagine that you can't figure out the code to erase the screen.