diff options
author | Andinus <andinus@nand.sh> | 2021-10-04 19:14:12 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-10-04 19:14:12 +0530 |
commit | 6b089c12853683b7b748aedd9adf84c2ca804324 (patch) | |
tree | a2d40c8aca3837fa0fa21d7d34f10ed3e0933ed2 /raku/acronym | |
parent | 6cb0e630baeb9a5acddac65a627bd2f9bf291312 (diff) | |
download | exercism-6b089c12853683b7b748aedd9adf84c2ca804324.tar.gz |
Raku: Acronym: split on \s, replace comb with substr
Diffstat (limited to 'raku/acronym')
-rw-r--r-- | raku/acronym/Acronym.rakumod | 4 |
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) } |