例如我有 (list "a" "1" "b" "2" "c" "3")
.
现在我想把这个列表变成一个 "a1b2c3"
.
我该怎么做?
谢谢。
最佳答案
(apply string-append (list "a" "1" "b" "2" "c" "3"))
或 (string-append* "" (list "a" "1" "b" "2" "c" "3"))
应该工作。见:http://docs.racket-lang.org/reference/strings.html
如果你想要一个程序来做到这一点,你可以写 (define (strings->string sts) (apply string-append sts))
关于string - 如何将字符串列表转换为方案中的一个字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16880569/