如何将两个字符串列表合并为一个字符串列表?
例如,这个:
["aaaaaa", "aaaaaa","aaaaaa"]
["bbbb", "bbbb", " bb"]
会进入这个:
["aaaaaabbbb","aaaaaabbbb", "aaaaaa bb"]
答案 0 :(得分:5)
zipWith (++) ["aaaaaa", "aaaaaa","aaaaaa"] ["bbbb", "bbbb", " bb"]
答案 1 :(得分:4)
您可以使用zipWith
:
concatStrings :: [String] -> [String] -> [String]
concatStrings = zipWith (++)