Reputation: 1057
How would one construct a code that inserts b blank characters in between two input strings? Concretely I am asking about a function which inputs
(newfn "AAA" "ZZZ" 10)
and outputs 10 blanks between the strings "AAA" and "ZZZ"
Upvotes: 0
Views: 168
Reputation: 2455
(defn wrap-spaces [h t n]
(let [blanks (apply str (repeat n " "))]
(str h blanks t)))
(wrap-spaces "AAA" "ZZZ" 10)
Upvotes: 1