我试图使用(string-split "a,b,c" ",")
的地图来将列表中的字符串拆分。如何使用具有需要更多参数的函数的地图
(string-split "a,b,c" ",")
'("a" "b" "c")
以下工作如果字符串分割,而不使用 “ ”:
(define sl (list "a b c" "d e f" "x y z"))
(map string-split sl)
'(("a" "b" "c") ("d" "e" "f") ("x" "y" "z"))
但以下不绕列表拆分字符串“,”:
(define sl2 (list "a,b,c" "d,e,f" "x,y,z"))
(map (string-split . ",") sl2)
'(("a,b,c") ("d,e,f") ("x,y,z"))
哪有我使用需要额外参数的函数的地图?
'(map(lambda(x)(string-split x“,”))lst)' – leppie
最简单!你应该输入它作为答案。 – rnso