How to remove a specific Character from LCD 16x2 while keeping others ?

hello guys,
i hope it's the right section to put this in
i am using an LCD 16x2 on which i want to show values from hall effect sensor on the first line and on the second line i have status of 2 Push button, first button is red LED and on the screen is "T-L:" and second button is blue LED and on the screen is "B-L:"
so when the red LED is on i want to print on the LCD: T-L: ON and when off T-L:OFF
same for the blue LED so the final format is this with the spaces :
T-L: ON B-L:OFF

what is happening is that when i am changing from OFF to ON, and extra O is keeping visible like this :
T-L: OON B-L:ONN
so what i want to know is how to clear the OFF world and write ON please ?

here are my codes including the push button, the LEDs and the virtual Wire codes (you can ignore this part, if no let me know please to remove it):

//Sketch of the Controller of the RC car - Firas Helou
//Version September 6 2015

// include the libraries code for LCD and wireless RF Links :
#include <LiquidCrystal.h>
#include <VirtualWire.h>


const byte Red_LED = 2; //Top LEDs ON/OFF indicator
const byte Blue_LED = 4; //Bottom LEDs ON/OFF indicator

const byte TX_Pin = 3; //TX that sends data from the controller to the car
const byte RX_Pin = 5; //RX that receives data sent from the car

const byte RedLeds_Button = 6; //Push Button that turns the Top red LEDs on
const byte BlueLeds_Button = 7; //Push Button that turns the Bottom blue LEDs on

String TopLed = "";
String BottomLed = "";

LiquidCrystal lcd(8, 9, 10, 11, 12, 13); //defining the LCD pins

//controlling transmitter initially 12 - TX
int ArrayController[5];

boolean lastRedLed = LOW;
boolean currentRedLed = HIGH;
boolean RedLedOn = false;

boolean lastBlueLed = LOW;
boolean currentBlueLed = HIGH;
boolean BlueLedOn = false;

byte valRedLedButton = 0;  
byte valBlueLedButton = 0;

//controlling receiver - RX
int receivingArray[5];


void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  
  lcd.setCursor(3, 0);
  lcd.print("KM/H:");
  /*lcd.setCursor(0, 1);
  lcd.print("T-L:");
  lcd.print(TopLed);
  
  lcd.setCursor(9, 1);
  lcd.print("B-L:");
  lcd.print(BottomLed);*/
  
  //Transmitter setup
  vw_set_tx_pin(TX_Pin); //RF sending pin 
  vw_setup(2000);	 // Bits per sec
  
  vw_set_rx_pin(RX_Pin);
  vw_rx_start(); 
  
  pinMode( RedLeds_Button, INPUT_PULLUP ); //RedLeds Button
  pinMode( BlueLeds_Button, INPUT_PULLUP ); //BlueLeds Button
  pinMode( Red_LED, OUTPUT ); //Red Led indicator Top LEDs
  pinMode( Blue_LED, OUTPUT ); //Blue Led indicator Bottom LEDs
    
}

//Debouncing function
boolean debounce(boolean last, int button)
{
  boolean current = digitalRead(button);
  if(last != current)
  {
    delay(5);
    current = digitalRead(button);
  }
  return current;
}

//Main Loop
void loop()
{  
  currentRedLed = debounce(lastRedLed, RedLeds_Button);
  currentBlueLed = debounce(lastBlueLed, BlueLeds_Button);
  
  if(lastRedLed == HIGH && currentRedLed == LOW){
    
    RedLedOn = !RedLedOn;
    valRedLedButton = 1;
  }else if(lastRedLed == LOW && currentRedLed == HIGH){
    valRedLedButton = 0;
  }
    
  lastRedLed = currentRedLed;
  digitalWrite(Red_LED, RedLedOn);
  
  lcd.setCursor(0, 1);
  lcd.print("T-L:");
  if(RedLedOn == HIGH){
    TopLed = "ON";
    lcd.setCursor(5, 1);
    lcd.print(TopLed);
    
  }else if(RedLedOn == LOW){
    TopLed = "OFF";
    lcd.setCursor(4, 1);
    lcd.print(TopLed);
  }
  
  //if(TopLed == "ON"){
    //lcd.setCursor(5, 1);
    //lcd.print(TopLed);
  //}else if(TopLed == "OFF"){
   // lcd.setCursor(4, 1);
   // lcd.print(TopLed);
  //}
  if(lastBlueLed == HIGH && currentBlueLed == LOW){
    
    BlueLedOn = !BlueLedOn;
    valBlueLedButton = 1;
  }else if(lastBlueLed == LOW && currentBlueLed == HIGH){
    valBlueLedButton = 0;
  }
    
  lastBlueLed = currentBlueLed;
  digitalWrite(Blue_LED, BlueLedOn);
  
  lcd.setCursor(9, 1);
  lcd.print("B-L:");
  if(BlueLedOn == HIGH){
    BottomLed = "ON";
    lcd.setCursor(14, 1);
    lcd.print(BottomLed);
  }else if(BlueLedOn == LOW){
    BottomLed = "OFF";
    lcd.setCursor(13, 1);
    lcd.print(BottomLed);
  }
  
 /* if(BottomLed == "ON"){
    lcd.setCursor(14, 1);
    lcd.print(BottomLed);
  }else if(BottomLed == "OFF"){
    lcd.setCursor(13, 1);
    lcd.print(BottomLed);
  }*/
  
  
  ArrayController[0] = valRedLedButton;
  ArrayController[1] = valBlueLedButton;
  
  vw_send((uint8_t*) & ArrayController, sizeof(ArrayController));
  vw_wait_tx(); 
  
}// --- end of main Loop

Use "ON " instead. (extra space on the back end after the N )

You might want to use simple char pointers instead of String type.
i.e. declare TopLED and BottomLED as char * instead of String.
(will save some resources)
--- bill

bperrybap:
Use "ON " instead. (extra space on the back end after the N )

what do you mean ? because i don't think this will eliminate the extra O on the Left :frowning:

bperrybap:
You might want to use simple char pointers instead of String type.
i.e. declare TopLED and BottomLED as char * instead of String.
(will save some resources)
--- bill

i did declared them char before but it gave me an error said : invalid conversion from 'const char' to 'char' :confused:

ok I found a way to solve this and it is by using char:

i added this to the top:

//letter O
byte letter_O[8] = { 
	0b01110,
	0b10001,
	0b10001,
	0b10001,
	0b10001,
	0b10001,
	0b01110,
	0b00000
};

//letter N
byte letter_N[8] = {
	0b10001,
	0b10001,
	0b11001,
	0b10101,
	0b10011,
	0b10001,
	0b10001,
	0b00000
};

//letter F
byte letter_F[8] = {
	0b11111,
	0b10000,
	0b10000,
	0b11110,
	0b10000,
	0b10000,
	0b10000,
	0b00000
};

//empty
byte empty[8] = {
	0b00000,
	0b00000,
	0b00000,
	0b00000,
	0b00000,
	0b00000,
	0b00000,
	0b00000
};

and these lines in the main loop:

if(RedLedOn == HIGH){
    //TopLed = "ON ";
    lcd.setCursor(4, 1);
    lcd.write(3);
    lcd.setCursor(5, 1);
    //lcd.print(TopLed);
    lcd.write((byte)0);
    lcd.setCursor(6,1);
    lcd.write(1);
    
  }else if(RedLedOn == LOW){
    //TopLed = "OFF";
    lcd.setCursor(4, 1);
    //lcd.print(TopLed);
    lcd.write((byte)0);
    lcd.setCursor(5,1);
    lcd.write(2);
    lcd.setCursor(6,1);
    lcd.write(2);
  }
  
  //if(TopLed == "ON"){
    //lcd.setCursor(5, 1);
    //lcd.print(TopLed);
  //}else if(TopLed == "OFF"){
   // lcd.setCursor(4, 1);
   // lcd.print(TopLed);
  //}
  if(lastBlueLed == HIGH && currentBlueLed == LOW){
    
    BlueLedOn = !BlueLedOn;
    valBlueLedButton = 1;
  }else if(lastBlueLed == LOW && currentBlueLed == HIGH){
    valBlueLedButton = 0;
  }
    
  lastBlueLed = currentBlueLed;
  digitalWrite(Blue_LED, BlueLedOn);
  
  lcd.setCursor(9, 1);
  lcd.print("B-L:");
  if(BlueLedOn == HIGH){
    //BottomLed = "ON";
    lcd.setCursor(13, 1);
    lcd.write(3);
    lcd.setCursor(14, 1);
    //lcd.print(TopLed);
    lcd.write((byte)0);
    lcd.setCursor(15,1);
    lcd.write(1);
    //lcd.print(BottomLed);
  }else if(BlueLedOn == LOW){
    //BottomLed = "OFF";
    lcd.setCursor(13, 1);
    lcd.write((byte)0);
    lcd.setCursor(14,1);
    lcd.write(2);
    lcd.setCursor(15,1);
    lcd.write(2);
    //lcd.print(BottomLed);
  }

You are using different positions for "Off" and "On".

Use the same and print (as already suggested) "On " instead of "On".

  if(RedLedOn == HIGH){
    TopLed = "ON";
    lcd.setCursor([b]5[/b], 1);
    lcd.print(TopLed);
   
  }else if(RedLedOn == LOW){
    TopLed = "OFF";
    lcd.setCursor([b]4[/b], 1);
    lcd.print(TopLed);
  }

Whandall:
You are using different positions for "Off" and "On".

Use the same and print (as already suggested) "On " instead of "On".

  if(RedLedOn == HIGH){

TopLed = "ON";
    lcd.setCursor(5, 1);
    lcd.print(TopLed);
 
  }else if(RedLedOn == LOW){
    TopLed = "OFF";
    lcd.setCursor(4, 1);
    lcd.print(TopLed);
  }

i tried, i did this :
TopLed = "ON "; instead of TopLed = "ON";

i got the same result :confused:
isn't this what you mean ?

Did you read my last message?

Did you change the

lcd.setCursor(5, 1);
lcd.setCursor(4, 1);

to the same position?

Whandall:
Did you read my last message?

Did you change the

lcd.setCursor(5, 1);
lcd.setCursor(4, 1);

to the same position?

yes i did read it, but nothing has changed before it was 5 for ON and 4 fot OFF