Paste: A string replace word
Author: | paldepind |
Mode: | factor |
Date: | Sat, 22 Dec 2012 12:13:45 |
Plain Text |
: replace ( string char1 char1 -- string' )
[ [ over = ] dip swap [ swap drop ] [ drop ] if ] 2curry map
;
Author: | tgunr |
Mode: | factor |
Date: | Sat, 22 Dec 2012 14:07:56 |
Plain Text |
: replace ( string char char -- string' )
[
[ over = ] dip
swap
[ swap drop ]
[ drop ] if
] 2curry map ;
Author: | noam |
Mode: | factor |
Date: | Sat, 22 Dec 2012 18:00:03 |
Plain Text |
: replace ( string char1 char1 -- string' )
'[ dup _ = [ drop _ ] when ] map ;
New Annotation