May 12, 2016

meaing of strspn and strcspn

strspn(char * hay, char *charlist)
Search for a "span" of string that contains entirely of characters in the charlist. spn stands for "span", probably.

strcspn(char* hay, char *charlist)
Search for a "complimentary span", i.e. a span that has no characters from the charlist.

strpbrk(char *hay, char *charlist)
"Pointer Break", search in hay for the first occurrance of any char from charlist.

No comments:

Post a Comment