Problem with comparing serial data

Im a newbie to c++ programing. I write program that send some character to arduino and it will be displayed on LCD.
I want if “cls” string was send to board the LCD become clear. But I get error.
This is the Code:

char (incomingByte) = 0; // for incoming serial data
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
lcd.begin(16, 2) ;

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte =;

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte) ;
lcd.print (incomingByte);
if ( incomingByte == “cls”) lcd.clear ;


What changes are needed?
sorry for my bad english

Two things.

  1. The code icon is the #, it is next to the quote. Do not use the quote when posting code.

cls is three bytes. How can one byte ever be equal to three bytes?

You need some way of marking the end of an input string, a line feed or carriage return are most common. You keep gathering bytes into the input string and only do the comparison where you have the complete string.