小编kat*_*tie的帖子

为什么System.Char []输出而不是字符串值?

let reverseString (myStr: string)=
    myStr|>Seq.toList|>List.rev |> Array.ofList|>string
Run Code Online (Sandbox Code Playgroud)

我正在F#中为此功能工作。我运行上面的一个并想得到例如我做的结果

reverseString "abc"
Run Code Online (Sandbox Code Playgroud)

我希望它将显示出来,cba但实际上它返回System.Char []。那可能是问题所在,因为我想查看类似“ cba”的结果,而不是检查我做对了还是不正确。谢谢!

string f#

1
推荐指数
1
解决办法
98
查看次数

标签 统计

f# ×1

string ×1