Skip to content

Instantly share code, notes, and snippets.

@akimboyko
Created May 4, 2014 05:30
Show Gist options
  • Save akimboyko/7a8cb1e1f0e0904f3c34 to your computer and use it in GitHub Desktop.
Save akimboyko/7a8cb1e1f0e0904f3c34 to your computer and use it in GitHub Desktop.
Count number of letters written out in words without spaces or hyphens using F# and Humanizer https://github.com/MehdiK/Humanizer
#r @"Humanizer.dll"
open Humanizer
[1 .. 1000] |>
Seq.map (fun n -> Humanizer.NumberToWordsExtension.ToWords(n)) |>
Seq.collect(fun writtenOutInWords -> writtenOutInWords.ToCharArray()) |>
Seq.where(fun ch -> ch <> ' ') |>
Seq.where(fun ch -> ch <> '-') |>
Seq.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment