Help with program function calls

Still have the same issue:

//----------------- Problem appears in this function call ----------------------------
void processCmd(String thing) {
  Serial.println("In processCmd thing is : ");
  Serial.print(">>");
  Serial.print(thing);
  Serial.println("<<");
  
  if (thing == "X") {
    Serial.println("Made it this far");//test if thing = X. No idea why this does not work, logically it looks OK.
  }
}

Just to explain, I have a number on control chrs to change for example the step direction or speed or to enable/disable the motor controller, I've just made it 'X' for the moment to try and resolve this issue. So the comparison of the var 'thing' and 'X' should result in a true result but for some reason it appears that program flow just jumps straight over the IF statement as if it was not even there.

Go to say I've not had this issue with PIC micro's, weird..

Need to wear safety glasses I think!

Thanks

Bodge