LED control with serial communication

int whiteled = 13;
int redled = 11;
int blueled = 12;

String readString;

void setup() {
  Serial.begin(9600);
  pinMode(whiteled, OUTPUT); 
   pinMode(redled, OUTPUT); 
    pinMode(blueled, OUTPUT); 
  
}

void loop() {

  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }

  if (readString.length() >0) {
    Serial.println(readString);

    if(readString.indexOf("red") >=0)
    {
      digitalWrite(redled, HIGH);
      delay(1000);
      digitalWrite(redled, LOW);
      delay(1000);
      
    }

    if(readString.indexOf("blue") >=0)
    {
      digitalWrite(blueled, HIGH);
      delay(1000);
      digitalWrite(blueled, LOW);
      delay(1000);
  
    }
        if(readString.indexOf("white") >=0)
    {
      digitalWrite(whiteled, HIGH);
      delay(1000);
      digitalWrite(whiteled, LOW);
      delay(1000);
    
    }
    else
    {digitalWrite(whiteled, HIGH);
      delay(1000);
      digitalWrite(whiteled, LOW);
      delay(1000);
      digitalWrite(blueled, HIGH);
      delay(1000);
      digitalWrite(blueled, LOW);
      delay(1000);
     
      digitalWrite(redled, HIGH);
      delay(1000);
     
      digitalWrite(redled, LOW);
      delay(1000);}

    readString="";
  } 
}

i'm trying to control the LED if the input is "Red" or "rEd" or "REd" etc. So regardless of if the input has capital letters , it should switch on the respective led. how do i do it?

Either compare the strings regardless of the case, or convert it to upper or lower case before comparing. Since "String.indexOfRegardlessOfCase" (or something like that) does not exist, make everything upper case with : http://www.arduino.cc/en/Reference/StringToUpperCase Example : http://www.arduino.cc/en/Tutorial/StringCaseChanges

With the good old 'c'-language, there is a function to compare regardless of case: stricmp(). But that function doesn't work with a String object.

Thank you. i'll look into it right away!