string parsing occurrence in c

Posted by Dan74 on Stack Overflow See other posts from Stack Overflow or by Dan74
Published on 2010-04-18T22:56:46Z Indexed on 2010/04/18 23:03 UTC
Read the original article Hit count: 281

Filed under:
|

I have a string as const char *str = "Hello, this is an example of my string";

How could I get everything after the first comma. So for this instance: this is an example of my string

I was planing to do something like:

// pseudocode
char *a, *b;
loop {
   if((a = strchr(l, ',')) == NULL) break;
   b++;
   // but not sure here
}
printf("%s",a);

Thanks

© Stack Overflow or respective owner

Related posts about string

Related posts about c