summary refs log tree commit diff stats
path: root/raku/acronym/Acronym.rakumod
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-08 22:26:42 +0530
committerAndinus <andinus@nand.sh>2021-09-08 22:26:42 +0530
commit39a144c85aa4229345463280d4f61266350a6527 (patch)
tree15b7c9aeedfaee8700c8e79b1f73c0716de23a13 /raku/acronym/Acronym.rakumod
parent2cccd54aaa588c7446417b00c6ece21f69fbd8ec (diff)
downloadexercism-39a144c85aa4229345463280d4f61266350a6527.tar.gz
Raku: Acronym: Add solution
Diffstat (limited to 'raku/acronym/Acronym.rakumod')
-rw-r--r--raku/acronym/Acronym.rakumod5
1 files changed, 5 insertions, 0 deletions
diff --git a/raku/acronym/Acronym.rakumod b/raku/acronym/Acronym.rakumod
new file mode 100644
index 0000000..401d867
--- /dev/null
+++ b/raku/acronym/Acronym.rakumod
@@ -0,0 +1,5 @@
+unit module Acronym;
+
+sub abbreviate(Str $phrase --> Str) is export {
+    $phrase.split((' ', '-'), :skip-empty).map(*.comb(/<[a..zA..Z]>/).first).join.uc
+}