summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-10-04 19:14:12 +0530
committerAndinus <andinus@nand.sh>2021-10-04 19:14:12 +0530
commit6b089c12853683b7b748aedd9adf84c2ca804324 (patch)
treea2d40c8aca3837fa0fa21d7d34f10ed3e0933ed2
parent6cb0e630baeb9a5acddac65a627bd2f9bf291312 (diff)
downloadexercism-6b089c12853683b7b748aedd9adf84c2ca804324.tar.gz
Raku: Acronym: split on \s, replace comb with substr
-rw-r--r--raku/acronym/Acronym.rakumod4
1 files changed, 1 insertions, 3 deletions
diff --git a/raku/acronym/Acronym.rakumod b/raku/acronym/Acronym.rakumod
index 225ae9c..ce9c39a 100644
--- a/raku/acronym/Acronym.rakumod
+++ b/raku/acronym/Acronym.rakumod
@@ -1,7 +1,5 @@
 unit module Acronym;
 
 sub abbreviate(Str $phrase --> Str) is export {
-    [~] $phrase.uc.split((' ', '-'), :skip-empty).map(
-        *.comb(/<[A..Z]>/).first
-    )
+    [~] $phrase.split(/<[-_\s]>/).map(*.substr(0, 1).uc)
 }