2
如何計算f#中字符串的元音?f如何計算字符串中的元音#
let inputText = "sdhkjhsakdnadwqerdsdasefds"
let vowels = ["a";"e";"i";"o";"u"]
let count inputText = Seq.filter ((=) vowels) >> Seq.length
printfn "%A" count
Console.ReadLine() |> ignore
你使用FSI(F#interactive)嗎?您可以在FSI中使用Alt-Enter在Visual Studio或VS Code中運行代碼,並以較小的塊解決像這樣的問題。它應該可以幫助你更快地學習。 – TheQuickBrownFox