What's the canonical way to join strings in a list?

前端 未结 6 1931
慢半拍i
慢半拍i 2020-12-03 01:12

I want to convert (\"USERID=XYZ\" \"USERPWD=123\") to \"USERID=XYZ&USERPWD=123\". I tried

(apply #\'concatenate \'string \'(\"         


        
6条回答
  •  日久生厌
    2020-12-03 01:47

    Use FORMAT.

    ~{ and ~} denote iteration, ~A denotes aesthetic printing, and ~^ (aka Tilde Circumflex in the docs) denotes printing the , only when something follows it.

    * (format nil "~{~A~^, ~}" '( 1 2 3 4 ))
    
    "1, 2, 3, 4"
    * 
    

提交回复
热议问题