home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff218.lzh / EdLib / strcspn.c < prev    next >
Text File  |  1989-06-04  |  469b  |  22 lines

  1. /*
  2.  * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  3.  * This code is freely redistributable as long as no charge other than
  4.  * reasonable copying fees are levied for it.
  5.  */
  6.  
  7. /* Return the number of characters NOT from "charset" that are at the
  8.  * BEGINNING of string "string".
  9. */
  10.  
  11. int strcspn(str, charset)
  12. register char *str, *charset;
  13. {
  14.         register char *temp = str;
  15.  
  16.         while (!strchr(charset, *temp))
  17.                 ++temp;
  18.  
  19.         return(temp - str);
  20. }
  21.  
  22.