From 6b089c12853683b7b748aedd9adf84c2ca804324 Mon Sep 17 00:00:00 2001 From: Andinus Date: Mon, 4 Oct 2021 19:14:12 +0530 Subject: Raku: Acronym: split on \s, replace comb with substr --- raku/acronym/Acronym.rakumod | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'raku/acronym') 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) } -- cgit 1.4.1-2-gfad0