RosettaCodeData/Task/Strip-comments-from-a-string/F-Sharp/strip-comments-from-a-strin...

6 lines
140 B
Forth

let stripComments s =
s
|> Seq.takeWhile (fun c -> c <> '#' && c <> ';')
|> Seq.map System.Char.ToString
|> Seq.fold (+) ""