Paste: A string replace word

Author: paldepind
Mode: factor
Date: Sat, 22 Dec 2012 12:13:12
Plain Text |
! Takes a string two characers and replace every instance of char1 with char2 in the string
: replace ( string char1 char1 -- string' ) 
    [ [ over = ] dip swap [ swap drop ] [ drop ] if ] 2curry map 
;

New Annotation

Summary:
Author:
Mode:
Body: