aboutsummaryrefslogtreecommitdiff
path: root/challenge-331/hvukman/f#/331_p1.fs
blob: 93291e5af5ba5c12b6ab8a6993d67ab43225ffe6 (plain)
1
2
3
4
5
6
7
// part 1
// Trim white space, split at space, take last and length
printf "part 1\n"
let lastword (x:string) = x.Trim(' ').Split(" ") |> Array.last |> String.length
printf "%i\n" (lastword "The Weekly Challenge")
printf "%i\n" (lastword " hello world    ")
printf "%i\n" (lastword "Let's begin the fun")