在 F# 交互式中,我可以成功地使用 String.Join("+", ["a"; "b"])
,但是
["a"; "b"] |> String.Join "+"
会产生一个错误:
Script1.fsx(79,15): error FS0001: This expression was expected to have type
string list -> 'a
but here has type
string
我该如何使用 String.Join
并通过管道传递集合?
P.S. lines |> File.WriteAllLines "filename.txt"
也存在相同的问题。
seq<string>
。 - Tomas Petricek