Get rid of unwanted information from serial.read()

Hi,

I just need your help.

How can I get rid of unwanted information feed by serial.read(), example this,

+CMT: "+6XXXXXXXXXXX","","16/05/18,15:36:07+32"

The only thing that I'm interested is the message being sent.

Here's my code:

  String content = "";
  char character;

  while(Serial.available()) {
      character = Serial.read();
      content.concat(character);
  }

  if (content != "") {
    Serial.println(content);
  }

Help is highly appreciated.

Thanks.

thread solved.

How'd you solve it? Please share.

Basically you'll read all characters sent to you by the gsm.

+CMT: "+6XXXXXXXXXXX","","16/05/18,15:36:07+32"

Until you get the first character of the message your interested with then start storing them.

if(SIM900.available() >0)
  {
    incoming_char=SIM900.read(); //Get the character from the cellular serial port.
    Serial.print(incoming_char); //Print the incoming character to the terminal.
}