aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHVukman <peterslopp@googlemail.com>2025-07-27 19:11:50 +0200
committerGitHub <noreply@github.com>2025-07-27 19:11:50 +0200
commit0cca24f00e6665ccbf3843fbf0fefe25b0f7a0a0 (patch)
tree794eef1bf98d449c80a9bb6c6c902b20d0feb38d
parent5b3fad24f1e302c82c7f838af5593b90ca6bc353 (diff)
downloadperlweeklychallenge-club-0cca24f00e6665ccbf3843fbf0fefe25b0f7a0a0.tar.gz
perlweeklychallenge-club-0cca24f00e6665ccbf3843fbf0fefe25b0f7a0a0.tar.bz2
perlweeklychallenge-club-0cca24f00e6665ccbf3843fbf0fefe25b0f7a0a0.zip
Create 331_p1.fs
-rw-r--r--challenge-331/hvukman/f#/331_p1.fs7
1 files changed, 7 insertions, 0 deletions
diff --git a/challenge-331/hvukman/f#/331_p1.fs b/challenge-331/hvukman/f#/331_p1.fs
new file mode 100644
index 0000000000..93291e5af5
--- /dev/null
+++ b/challenge-331/hvukman/f#/331_p1.fs
@@ -0,0 +1,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")