develooper Front page | perl.beginners | Postings from December 2002

Re: transforming strings to an array of characters

Thread Previous
From:
Stefan Lidman
Date:
December 9, 2002 04:32
Subject:
Re: transforming strings to an array of characters
Message ID:
3DF48D8C.FE5EF54A@student.luth.se
@word_list = split //, $word;

$nrOfLetters = @word_list;

Erik Browaldh wrote:
> 
> hi everyone!
> 
> if  I have a string, lets say
> $word="perl";
> 
> I want to copy this so I have something like this:
> @word_list["p","e","r","l"]
> 
> also, how do I get the length of @word_list?
> 
> thanks in advance!
> Erik
> 
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org

Thread Previous


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