我有一个包含字符串的列表:[“one”; “二”; "三"] - 如何在 F# 中打印它?

问题描述 投票:0回答:1
let stringList = ["one"; "two"; "three"]

如何在 F# 中打印 stringList?

let stringList = ["one", "two", "three"]

let function2() =
  for i in 2 .. 3 do
    printf " "
  printfn "i"
function2()

我期待的是:“一”、“二”、“三”

string list printing f#
1个回答
0
投票
let l = ["one"; "two"; "three"]
printf "%A" l

在此处找到有关打印的文档:https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/plaintext-formatting

© www.soinside.com 2019 - 2024. All rights reserved.