Hi....
I want to do following......... I have a string... "service-name-you" I want to get string "you" extracted only if the "service" is the first item before the first "-"
following is the code I have so far.....
Code:
for (loop = 0; loop < numEntries; loop++)
{
strsplit = strstr(entries[loop].name,"services-");
strsplit = strstr(strsplit,"-");
if((serviceName = strchr(strsplit,'-')) != NULL)
strcpy(serviceName,serviceName+1);
LOGINFO("Somiiii restrictions %s",serviceName);
}
basically as an example..... entries[loop].name holds string such as....
"you-me-other"
"me-all-you"
"service-name-you"
numEntries = 3 in this case.
So when it hit "service-name-you" and has "service" in it I want to extract "you"
out of it
Please help me as I am struggling......
Thanks alot in advance