Counting the number of tokens in a String.
Posted on 2007-03-29
I've been messing around trying to get the most efficient possible method and here is what I have:
const char *String_Contains(const char *s1, const char *s2)
int s1Len = String_Length(s1);
int s2Len = String_Length(s2);
for(; s1Len >= s2Len; ++s1, --s1Len)
What I do is pass in 2 strings, 1 is a full string, while the other is a string containing seperators. Then I loop through and count the number of times I find a seperator and return them as a char.
Any improvements or errors that I may have