9 years, 8 months 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

7 years, 6 months ago.

strstr(a,"unixtime");

esta es la manera correcta...