develooper Front page | perl.perl6.users | Postings from February 2019

Re: split and nils?

Thread Previous | Thread Next
From:
yary
Date:
February 6, 2019 22:33
Subject:
Re: split and nils?
Message ID:
CAG2CFAYTNE5p5=cFi8LDYxiVnDZW1EBnsh-+w8a_XVYxMSMQqg@mail.gmail.com
On Wed, Feb 6, 2019, 11:57 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> said


What would be the most practice way of converting a string to and
array of characters


Brad said-

You should be using `comb` if you want a list of characters not `split`.

# these are all identical
'abcd'.comb.kv
'abcd'.comb(1).kv
comb( 1, 'abcd' ).kv

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About