Ethernet code problem

Hello,

I am trying to control LEDs via telnet.
All what i want to do is send "11111" to arduino to turn on the 5 LEDs or send "11000" to turn on the first two and turn off the rest.
Any command i send it turns all on and can't turn them off.

Here's my code

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10,0,0,151 };
Server server(23);
int pinArray[] = {2, 3, 4, 5, 6};
int Max = 4;
String readString;
boolean Comm = LOW;


void setup() {
  // initialize the ethernet device
  Ethernet.begin(mac, ip);
  // start listening for clients
  server.begin();
  // open the serial port for logging
  Serial.begin(9600);
  for (int count=0;count<5;count++) {
    pinMode(pinArray[count], OUTPUT);
  }
}

void loop()
{
   Client client = server.available();   
   while (client.connected()) {
      if (client.available()) {
      char c = client.read();
      if (readString.length() < Max + 1) {
          //store characters to string 
          readString += c; 
        } 
        // command complete
        if (c == '\n') {
          //Serial.println(readString);
          for (int i=0; i <= Max; i++){
            Serial.println (readString[i]);
            if (readString[i] == "0"){
              Comm = LOW;
            }else{
              Comm = HIGH;            
            }
            digitalWrite(pinArray[i],Comm);
          }          
          readString = "";
        }
      }
    }
}

What is wrong with my code ?
Also.. is there any recommendations for my code or modifications make it better ?

Thanks all in advanced.

Added some debug print statements, please give it a try...

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10,0,0,151 };
Server server(23);
int pinArray[] = {2, 3, 4, 5, 6};
int Max = 4;
String readString;
boolean Comm = LOW;


void setup()
{
  // initialize the ethernet device
  Ethernet.begin(mac, ip);
  // start listening for clients
  server.begin();

  // open the serial port for logging
  Serial.begin(9600);

  for (int count=0;count<5;count++) 
  {
    pinMode(pinArray[count], OUTPUT);
  }
}


void loop()
{
  Client client = server.available();   
  while (client.connected()) 
  {
     if (client.available())
    {
      char c = client.read();
      Serial.println ("read: ");
      Serial.println (c);

      if (readString.length() < Max + 1) 
      {
          //store characters to string 
          readString += c; 
      } 
      // command complete
      if (c == '\n') 
      {
        Serial.println ("length: ");
        Serial.println (readString[i], BYTE);

        for (int i=0; i <= readString.length(); i++)    // 
        {
          Serial.println (readString[i], BYTE);
          if (readString[i] == "0") digitalWrite(pinArray[i], LOW);
          else digitalWrite(pinArray[i], HIGH);
        }          
        readString = "";
      }
    }
  }
  Serial.println("Client disconnected");
}
            if (readString[i] == "0"){

The [] operator returns a character, either '0' or '1', if you send a series of characters containing only 0s and 1s.

The character '0' is not equal to the string "0". You must compare characters to characters.

            if (readString[i] == '0'){

PaulS, Wonderful. It works great thank ( :

And big thanks to PaulS for his post too..

Thank all