[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] STRING2LIST conversion



At 12:48 PM 01/27/96, luca.post@nettuno.it wrote:

>Is there a function to load a @list with string's characters as elements:
>
>                @list= func("anystring");
>
>returns $list[0]="a", .... $list[9]="g" ???
>
>I read getc must be avoided (SLOW!) ...

The function you want is split(); just split on nothing, e.g.:

        $string = "anystring";
        @list = split(//, $string);


--
Eric Folley          |     efolley@scsn.net
Columbia, SC  USA    |     http://www2.scsn.net/users/efolley/