Huzzah ESP8266 readStringUntil('\r') question

I've been testing my huzzah 8266 with the "Simple HTTP get webclient test" provided on the adafruit site. I was hoping to clear some confusion, namely:

    while(client.available()){
      String line = client.readStringUntil('\r');
      Serial.print(line);
    }

I was reading from a txt file on my site which is completely empty aside from the word:

red

I tried to manipulate the String variable, line, in an if statement; but it looks like the false branch is always launched

Serial.print(line);

if (line == "red"){
        Serial.print("\n\n Red has been detected");
   }
else{
        Serial.print("false")
}

strange enough; in my serial monitor, it will print the word red. However, the else statement is always launched and I always see "False" printed inside serial monitor. I have a feeling it has to do with carriage return, however, I don't think I understand what exactly is a carriage return. Is it safe to assume that carriage return is the same thing as saying end of file? (EOF)?

Is it safe to assume that carriage return is the same thing as saying end of file? (EOF)?

No. It IS safe to assume that if you post ALL of your code, we could help.

Before you do that, though, replace the Serial.print(line); statement in your code, just before the if statement, with this:

Serial.print("line: [");
Serial.print(line);
Serial.println("]");
line: [red]

is not the same as

line: [red
]

There is a trim() method in the String class that might be useful.

My solution has been to \r\n:

While (client.available ()) {
String line = client.readStringUntil ('\r\n');
Serial.print (line);
}

String line = client.readStringUntil ('\r\n');

Single quotes are for single characters. Can you post a picture of your keyboard with that one key circled?