5 years, 5 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

3 years, 3 months ago.

strstr(a,"unixtime");

esta es la manera correcta...