summary refs log tree commit diff stats
path: root/raku/acronym/Acronym.rakumod
diff options
context:
space:
mode:
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
+}