how to compare incoming byte from telnet with string

I have the problem with compare incoming byte from telnet with string on this below code . How to correct them? Anyone can help me to make it right please?

    if (client.available() > 0) {
      // read the bytes incoming from the client:
       char thisChar =client.read(); 
      // echo the bytes back to the client:
      server.write(thisChar);
      // echo the bytes to the server as well:
      Serial.write(thisChar);
      if (thisChar = "turn on") {
        Serial.println("Switch On");
      }
      if (thisChar = "turn off") {
        Serial.println("Switch off");
      }
      else {
      Serial.println("You key a wrong command, PLS key a correct one");
      }
       char thisChar =client.read(); 
      // echo the bytes back to the client:
      server.write(thisChar);
      // echo the bytes to the server as well:
      Serial.write(thisChar);
      if (thisChar = "turn on")

Read a single character then compare it with a string of several characters. Will that work I wonder ?

See http://gammon.com.au/serial

UKHeliBob:

       char thisChar =client.read(); 

// echo the bytes back to the client:
      server.write(thisChar);
      // echo the bytes to the server as well:
      Serial.write(thisChar);
      if (thisChar = "turn on")



Read a single character then compare it with a string of several characters. Will that work I wonder ?

See http://gammon.com.au/serial

Thank you UKHeliBob But what functions will you recommend me to use for reading a single character then compare it with a string of several characters?

Did you look at the link in my post ?

But what functions will you recommend me to use for reading a single character then compare it with a string of several characters?

Re-read your question. Does it really make sense?

if('a' == "thisIsABunchOfCharacters")
{
   // Doesn't matter what you put here. It will never be executed
}