Help with ignoring parts of code

So,sim900 gives this on serial when I read sms,and content of SMS is "Hello world",I'm planing to use that in strcmp and I only need a sms content,not time and other (+CMGR: "REC UNREAD","+385955199488","","17/05/27,22:04:31+08") So,how do I ignore everything but that last part,Hello world (It will not always be Hello world so keep that in mind) This is EXACTLY what SIM900 replays after command for reading SMS

+CMGR: "REC UNREAD","+385955199488","","17/05/27,22:04:31+08"
Hello world

Learn about parsing strings.

I managed to ignore all the code you didn’t post

I didn't post any code because I don't know what to write,If I knew what to do I wouldn't ask for help

Really? You said something about your SIM900 replaying something. How could it do that without code?

That code....

void setup() {
Serial1.begin(9600);
}
void loop() {
   char message[20];
   int charsRead;

   if (Serial1.available() > 0) {    
      charsRead = Serial1.readBytesUntil('\n', message, sizeof(message) - 1); 
      message[charsRead] = '\0';                   
   
   if (strcmp(message, "+CMTI:")  == 0){  //It actually says +CMTI: "SM",1 (Does something if I have SMS)
Serial1.print("AT+CMGR=1");  //"opens" SMS
} 
else {
  Serial1.print("Not a SMS");
}
 } 
}

How much of +CMGR: "REC UNREAD","+385955199488","","17/05/27, do you plan on fitting into a 20 character buffer?

I don't know,I am looking for a way to basically ignore that part (+CMGR: "REC UNREAD","+385955199488","","17/05/27,)
I'm working on a project that I get SMS,reads it,and if that SMS is something,does something (example:If i text LEDON to it,it should first read a SMS and than compare SMS to LEDON(not only LEDON,SMS can also be LEDOFF) (if (strcmp(message, "LEDON") == 0){//something}).
I hope you guys now understand what I'm trying to do

Is it terminated with a newline character? Just look for that.

I hope you guys now understand what I'm trying to do

Not a chance. Proper grammar, line breaks and punctuation work wonders when trying to communicate your ideas and desires to others, especially when asking for help.

I'm sorry but I'm learning 4 foreign languages,and english is not my first one.

So,I should split it where \n is (Just before a SMS) So when I split it,how do I use splitted data in a string?

I have been ignoring this Thread because I thought your title meant that you want to ignore some parts of your program code. But it seems that what you really want to do is to select parts of the text from a message.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. You probably need to use the second example. There is also a parse example to illustrate how to extract stuff from the received text.

Note that the demo uses a 32 byte array which may not be longe enough for you. You can change the variable numChars to make it bigger.

...R

What about something like this?

//String s = "something";
String tokens = s.split("/n");

Nikola19992:
What about something like this?

//String s = "something";
String tokens = s.split("/n");

Why don't you try it?

I’m not sure but I think that’s Java string,What does arduino version of that look like?

Nikola19992:
I'm not sure but I think that's Java string,What does arduino version of that look like?

Did you read Reply #12 and study the code in the link?

...R