From 70cadb4dffe89acb5fcb6265bfcf9e978121e83e Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 29 Sep 2021 09:56:59 +0530 Subject: Raku: Acronym: Use meta concat operator, uppercase the string first --- raku/acronym/Acronym.rakumod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'raku') 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 + ) } -- cgit 1.4.1-2-gfad0