: replace-string ( string old new -- string ) [ split1-slice ] dip over [ glue ] [ 2drop ] if ; : replace-pairs ( string from to -- string ) [ replace-string ] 2each ;