【发布时间】:2020-01-17 22:35:48
【问题描述】:
我在 lambda 函数中调用字符串方法“包含”,并想否定它。我认为这可以用not myString.Contains("abbr") 完成,但它给了我错误
Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized
我的实际功能是这个
open System.IO
let createWordArray filePath =
File.ReadLines(filePath)
|> Seq.filter (fun line -> line <> "")
|> Seq.filter (fun line -> not line.Contains("abbr.")) // Error occurs here
|> Seq.map (fun line -> line.Split(' ').[0])
|> Seq.filter (fun word -> word.StartsWith("-") || word.EndsWith("-"))
|> Seq.toArray
请指出我犯的任何其他明显错误。
【问题讨论】:
标签: f# f#-interactive