我試圖使用(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