strsep
Returns the specified substring
#include <string.h> int strsep ( char *string, int *which, const char *source);
Returns the nth substring. Otherwise, returns a pointer to NULL.
The source string must be correctly delimited by a character that does not otherwise occur in the string. The delimiter is assumed to be the first character of the source string. strsep will quit reading the string when it encounters NULL.
You must allocated enough memory to hold the result.
In the following string, "Tue" is the second substring:
:Sun:Mon:Tue:Wed:Thu:Fri:Sat: