[英]F# List of random numbers concatenated
有人可以告訴我為什么這樣做
let createRandomList = List.init 9 (fun _ -> randomNumberGenerator.Next(0,9))
let concatRandomList =
createRandomList
|> Seq.map string
|> String.concat ""
這不是嗎?
let createConcatRandomList = List.init 9 (fun _ -> randomNumberGenerator.Next(0,9))
|> Seq.map string
|> String.concat ""
我在第二個代碼塊上收到“不完整的值或函數定義”
提前致謝
在第二個示例中,您需要將|>
縮進到與List
相同的級別
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.