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

6 lines
140 B
Forth
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let stripComments s =
s
|> Seq.takeWhile (fun c -> c <> '#' && c <> ';')
|> Seq.map System.Char.ToString
|> Seq.fold (+) ""