home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / snip1292.zip / RMALLWS.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  566b  |  29 lines

  1. /*
  2. **  Originally published as part of the MicroFirm Function Library
  3. **
  4. **  Copyright 1986, S.E. Margison
  5. **  Copyright 1989, Robert B.Stout
  6. **
  7. **  Subset version released to the public domain, 1991
  8. **
  9. **  remove all whitespace from a string
  10. */
  11.  
  12. #include <stdio.h>
  13. #include <ctype.h>
  14.  
  15. #define NUL '\0'
  16.  
  17. char *rmallws(char *str)
  18. {
  19.       char *obuf, *nbuf;
  20.  
  21.       for (obuf = str, nbuf = str; *obuf && obuf; ++obuf)
  22.       {
  23.             if (!isspace(*obuf))
  24.                   *nbuf++ = *obuf;
  25.       }
  26.       *nbuf = NUL;
  27.       return str;
  28. }
  29.