home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / BIPL.ZIP / PROCS.ZIP / STRIP.ICN < prev    next >
Encoding:
Text File  |  1992-09-28  |  826 b   |  38 lines

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