2013-06-02 19 views

Odpowiedz

8

Nie wyważać otwartych drzwi! w rakieta, istnieje jedną procedurę specjalnie do tego celu, a jego nazywa string-join:

(string-join '("a" "1" "b" "2" "c" "3") "") 
=> "a1b2c3" 

Powołując się documentation:

(string-join strs     
      [sep     
       #:before-first before-first     
       #:before-last before-last    
       #:after-last after-last]) → string? 

strs : (listof string?) 
sep : string? = " " 
before-first : string? = "" 
before-last : string? = sep 
after-last : string? = "" 

Dołącza sznurki strs wkładania sep pomiędzy każdą parą ciągów Strs. before-last, before-first i after-last są analogiczne do wejść add-between: określają separator alternatywny między ostatnimi dwoma ciągami, łańcuchem prefiksu i łańcuchem sufiksu.

+0

Deweloper: czy chcesz skomentować? –

+0

Jest to również realizowane w Guile. – musarithmia

Powiązane problemy