You could search through the passed string for the occurance of the desired character. Perhaps using 'strchr()' or by cycling through the array and comparing each element.
Then simply get the characters that occured before the matched element and return them. Repeat your search for the required character n times or until you reach the end of the string.
for (i = 0; i < strlen(PassedInString); i ++)
if (PassedInString[i] == ThisCharacter) // do something about it
P.S. This: 'gettok(this is a string,1,32)' will generate any number of errors. You mean this: 'gettok("this is a string",1,32)'