How to filter a blank line received over serial - ESP8266 How can I filter a garbage completely blank line over my serial data? It comes from the wifi module ESP8266

How I read data:

  while (Serial1.available()){
       String inData = Serial1.readStringUntil('\n');

       Serial.println("Got: " + inData); 

  }


Here is my common output:

Got: AT+CIPSEND=6
Got: 
Got: OK
Got: &gt; 
Got: Recv 6 bytes
Got: 
Got: SEND OK
Got: 
Got: +IPD,21:Volume From: 99 To 89AT+CIPCLOSE
Got: CLOSED
Got: 
Got: OK
inData.trim();
if( inData.length() &gt; 0 ){
   Serial.println("Got: " + inData + "\n");


::trim() removes all leading and trailing whitespace characters including newlines. A line of [zero or more whitespace] + [newline] will get trimmed to the null string. If the result isn't null, then append the stripped off newline and print it. Note that this will flatten any indentation or vertical spacing that was supplied in the incoming text.