home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / string / strcspn.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  599 b   |  29 lines

  1. @node strcspn, string
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <string.h>
  6.  
  7. size_t strcspn(const char *s1, const char *set);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function finds the first character in @var{s1} that matches any
  13. character in @var{set}.  Note that the @code{NULL} bytes at the end of
  14. each string counts, so you'll at least get a pointer to the end of the
  15. string if nothing else. 
  16.  
  17. @subheading Return Value
  18.  
  19. The index of the found character.
  20.  
  21. @subheading Example
  22.  
  23. @example
  24. int i = strcspn(command, "<>|");
  25. if (command[i])
  26.   do_redirection();
  27. @end example
  28.  
  29.