Detecting a certain string via pc input and giving a response

I have recently followed a tutorial (By Robin) on Serial Input Basics. The tutorial worked great. I have tried adding a couple of lines to detect if a certain word was input, and if so give a response.

In the code below I want it to detect the word 'GOAL' and print the line "show green".

However it is not working as expected. The two lines I added are at the bottom of the code.

const byte numChars = 32;
char receivedChars[numChars];

boolean newData = false;

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() {
    recvWithStartEndMarkers();
    showNewData();
}

void recvWithStartEndMarkers() {
    static boolean recvInProgress = false;
    static byte ndx = 0;
    char startMarker = '<';
    char endMarker = '>';
    char rc;
 
 // if (Serial.available() > 0) {
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }
}

void showNewData() {
    if (newData == true) {
        Serial.print("This just in ... ");
        Serial.println(receivedChars);
        
          if (receivedChars == "GOAL"){  //added in this line
            Serial.println("show green");  //and this line
          }
         newData = false;
        }
}

Thanks

On this... If I use NOT EQUAL TO expression in the line:
if (receivedChars != "GOAL") { Serial.println("show green"); }

Then it brings up "show green" as soon as I type any word in the serial monitor, as expected.

receivedChars is a string. "GOAL" is a string. Comparisons between strings is done using strcmp(), NOT ==.

Great! Thanks, sorted it!