Re: Array remove duplicates question

2024-05-06 Thread ToddAndMargo via perl6-users
On 5/6/24 05:45, yary wrote: I thought you wanted them sorted also? [1] > (8,7,6,7,5,4,2,1).unique (8 7 6 5 4 2 1) [2] > (8,7,6,7,5,4,2,1).unique.sort (1 2 4 5 6 7 8) -y Hi Yary, Not in this instance. But the the command is really sweet. Thank you! This time I am going the extract IP

Re: Array remove duplicates question

2024-05-06 Thread yary
I thought you wanted them sorted also? [1] > (8,7,6,7,5,4,2,1).unique (8 7 6 5 4 2 1) [2] > (8,7,6,7,5,4,2,1).unique.sort (1 2 4 5 6 7 8) -y On Mon, May 6, 2024 at 6:15 AM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 5/6/24 03:07, ToddAndMargo via perl6-users wrote: > > >

Re: Array remove duplicates question

2024-05-06 Thread ToddAndMargo via perl6-users
On 5/6/24 03:07, ToddAndMargo via perl6-users wrote: On 6 May 2024, at 04:35, ToddAndMargo via perl6-users wrote: Hi All, I have thought of how to do it and pretty sure it would work, but just in case Raku have one of those sweet utilities, does Raku have a utility that will take an array

Re: Array remove duplicates question

2024-05-06 Thread ToddAndMargo via perl6-users
On 6 May 2024, at 04:35, ToddAndMargo via perl6-users wrote: Hi All, I have thought of how to do it and pretty sure it would work, but just in case Raku have one of those sweet utilities, does Raku have a utility that will take an array and remove all the duplicates and rearrange the cells

Re: Array remove duplicates question

2024-05-06 Thread Elizabeth Mattijsen
$ raku -e 'my @a = 1,2,3,6,7,1,2,8; @a .= unique; say @a' [1 2 3 6 7 8] https://docs.raku.org/type/Any#method_unique > On 6 May 2024, at 04:35, ToddAndMargo via perl6-users > wrote: > > Hi All, > > I have thought of how to do it and pretty sure > it would work, but just in case Raku have one

Re: Need regex ^? help

2024-05-06 Thread ToddAndMargo via perl6-users
This is what I have so far. my $x=" 1.2.3.4:12345 "; $x = $x.trim; $x~~s/(.*'.') .*/$0$(Q[0/24])/; say "<$x>"; <1.2.3.0/24> It works. Is there a way to petty it up with ^ and $ ?