summary refs log tree commit diff stats
path: root/raku/acronym/Acronym.rakumod
blob: 225ae9cadfff066f7ac14760ee369cb6ab3b6295 (plain) (blame)
1
2
3
4
5
6
7
unit module Acronym;

sub abbreviate(Str $phrase --> Str) is export {
    [~] $phrase.uc.split((' ', '-'), :skip-empty).map(
        *.comb(/<[A..Z]>/).first
    )
}