diff options
author | Andinus <andinus@nand.sh> | 2021-09-29 09:56:59 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-09-29 09:57:43 +0530 |
commit | 70cadb4dffe89acb5fcb6265bfcf9e978121e83e (patch) | |
tree | 8a224f1730318458db45914130f68c6da0ed422b | |
parent | e5a645e69fd969501cfff00b300e1aa02fdcbcd5 (diff) | |
download | exercism-70cadb4dffe89acb5fcb6265bfcf9e978121e83e.tar.gz |
Raku: Acronym: Use meta concat operator, uppercase the string first
-rw-r--r-- | raku/acronym/Acronym.rakumod | 4 |
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 + ) } |