Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (define replacements '(("a" "A") ("b" "B") ("c" "C")))
- (define (string-replace-multi str lst)
- (cond
- [(empty? lst) str]
- [(eq? (length lst) 1)
- (string-replace str
- (first (first lst))
- (last (first lst)))]
- [else
- (string-replace-multi (string-replace str
- (first (first lst))
- (last (first lst)))
- (rest lst))]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement