9 years ago.

strstr

NUCLEO-F401RE

char a[100];
char substr[100];

strcpy(a,"text:unixtime:1234567#");

 if (strstr("unixtime",rcv) != NULL) {
        
  strcpy(substr,strstr("unixtime",a));
  pc.printf("%s\r\n",substr);
}

Return only "unixtime" !!!! is not correct

1 Answer

6 years, 10 months ago.

strstr(a,"unixtime");

esta es la manera correcta...