Eeprom write read problem

#include <EEPROM.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 5); // RX, TX

long startMillis = 0;
long currentMillis = 0;
String Number;
String Phone1;
String Phone2;

void setup() {
 Serial.begin(9600);
 startMillis = millis(); 
 mySerial.begin(9600); 
}

void loop(void) {
  currentMillis = millis();
  ReceivedData();
  if (Serial.available() > 0){mySerial.write(Serial.read());}
}
//==========================================================
 String getMessage(){
  String msg = "";
  char t;
while(mySerial.available() > 0) {
      t = mySerial.read();
      msg+=String(t);
  }
  return msg;
}
//==========================================================
void ReceivedData(){
String msg = getMessage();
if(msg!=""){
  Serial.println(msg);
  if(msg=="phones"){
      String AAA;
      for(byte b=0 ; b < 12 ; b++){
      char f = EEPROM.read(b);
      AAA += (f);
      }
  Serial.println(AAA);
        String BBB;
      for(byte b=12 ; b < 24 ; b++){
      char f = EEPROM.read(b);
      BBB += (f);
      }
  Serial.println(BBB);
        }
  else if(msg=="del"){
    RemoveAllPhones();
  }
  msg=""; //reset cmd
 }
 msg=""; //reset cmd
}
void RemoveAllPhones(){
    String dell="000000000000";
      for(int i=0 ; i < 12 ; i++){EEPROM.write(i,dell[i]);}
      for(byte b=0 ; b < 12 ; b++){char f = EEPROM.read(b);Phone1 += (f);}
      for(int c=13 ; c < 25 ; c++){EEPROM.write(c,dell[c]);}
      for(byte v=13 ; v < 25 ; v++){char f = EEPROM.read(v);Phone2 += (f);}
      Serial.println(Phone1);
      Serial.println(Phone2);
      Phone1="";
      Phone2="";
}

When sending "del" via a serial monitor, apire strange characters when reading from eeprom. Somethings wrong when writing to eeprom.
Where is the problem?

Ard.jpg

Ard.jpg

Oops…

for(int c=13 ; c < 25 ; c++){EEPROM.write(c,dell[c]);}

Accessing “dell” from index 13 to 24.

Danois90:
Oops…

for(int c=13 ; c < 25 ; c++){EEPROM.write(c,dell[c]);}

Accessing “dell” from index 13 to 24.

Right ;} 10X

"dell" is 12 characters long and "dell[13]" does not exist, you do not need "dell" at all, just do "EEPROM.write(x, '0')" instead. Another bug is that you write "dell" to adresses 13..24, that should probably be 12..24 since that's where you read from in "ReceivedData". If you are using an AVR based board, your next problem will be crashes due to the usage of the "String" object.