summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-29 09:56:59 +0530
committerAndinus <andinus@nand.sh>2021-09-29 09:57:43 +0530
commit70cadb4dffe89acb5fcb6265bfcf9e978121e83e (patch)
tree8a224f1730318458db45914130f68c6da0ed422b
parente5a645e69fd969501cfff00b300e1aa02fdcbcd5 (diff)
downloadexercism-70cadb4dffe89acb5fcb6265bfcf9e978121e83e.tar.gz
Raku: Acronym: Use meta concat operator, uppercase the string first
-rw-r--r--raku/acronym/Acronym.rakumod4
1 files changed, 3 insertions, 1 deletions
diff --git a/raku/acronym/Acronym.rakumod b/raku/acronym/Acronym.rakumod
index 401d867..225ae9c 100644
--- a/raku/acronym/Acronym.rakumod
+++ b/raku/acronym/Acronym.rakumod
@@ -1,5 +1,7 @@
 unit module Acronym;
 
 sub abbreviate(Str $phrase --> Str) is export {
-    $phrase.split((' ', '-'), :skip-empty).map(*.comb(/<[a..zA..Z]>/).first).join.uc
+    [~] $phrase.uc.split((' ', '-'), :skip-empty).map(
+        *.comb(/<[A..Z]>/).first
+    )
 }