home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / STRIP.ICN < prev    next >
Text File  |  1991-07-13  |  724b  |  36 lines

  1. ############################################################################
  2. #
  3. #    Name:     strip.icn
  4. #
  5. #    Title:     strip characters from a string
  6. #
  7. #    Author:     Richard L. Goerwitz
  8. #
  9. #    Date:     June 3, 1991
  10. #
  11. #    Version: 1.1
  12. #
  13. ############################################################################
  14. #  
  15. #  strip(s,c)    - strip characters c from string s
  16. #
  17. ############################################################################
  18.  
  19. procedure strip(s,c)
  20.  
  21.     # Return string s stripped of characters c.  Succeed whether
  22.     # any characters c were found in s or not.
  23.  
  24.     local s2
  25.  
  26.     s2 := ""
  27.     s ? {
  28.     while s2 ||:= tab(upto(c))
  29.     do tab(many(c))
  30.     s2 ||:= tab(0)
  31.     }
  32.  
  33.     return s2
  34.  
  35. end
  36.