On Mon, Jun 12, 2017 at 5:17 AM, Francesco Rivetti <o...@oha.it> wrote:
> if you can:
>
> $s ~~ "foo"
> $s ~~ /foo/
>
> then wouldn't be good to have also:
>
> $s.contains("foo");
> $s.contains(/foo/);

The latter is currently available as:

> "foobar".match(/'foo'/);
「foo」


> IOW, overload .contains() with Str and Regex
>
> F
>
>
> On 06/12/2017 10:42 AM, Elizabeth Mattijsen wrote:
>>
>>
>>> On 12 Jun 2017, at 01:27, ToddAndMargo <toddandma...@zoho.com> wrote:
>>> perl6 -e 'my $x = "\t"; if $x !~~ /<[A..Z a..z 0..9]>/ {say "out"} else
>>> {say "in"}'
>>>
>>> Would this be easier to do with $x.contains?  Or would it
>>> be too worky?
>>
>>
>> .contains only takes a *single string* to look up.  So it is only useful
>> for checking whether “foo” exists in “foo bar”:
>>
>>    say “foo bar”.contains(“foo”)
>>
>>
>>
>> Liz
>>
>



-- 
Will "Coke" Coleda

Reply via email to