My string is \"A,B,C,D,E\" And the separator is \",\" How can I get the remaining string after doing strtok() once, that is \"B,C,D,E\"
char a[] = \"A,B,
If using strtok is not a requirement, you can use strchr instead since the separator is a single character:
strtok
strchr
char a[] = "A,B,C,D,E"; char *sep = strchr(a, ','); *sep = '\0'; puts(a); puts(sep + 1);