On Mon, Jun 12, 2017 at 4:07 PM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote:
>> On 12 Jun 2017, at 22:04, Will Coleda <w...@coleda.com> wrote:
>> 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」
>
> That’s not entirely true, as .contains returns a Bool:D, not a Match object.  
> It *could* be interesting to not have to build the entire Match object 
> somehow and just return a Bool:D in case of contains.
>
>
> Liz

Sorry, you're right, it's:

?"foobar".match(/'foo'/);


-- 
Will "Coke" Coleda

Reply via email to