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”的结果,而不是检查我做对了还是不正确。谢谢!