develooper Front page | perl.beginners | Postings from October 2009

Re: split n characters into n chunks

Thread Previous | Thread Next
Shlomi Fish
October 25, 2009 06:50
Re: split n characters into n chunks
Message ID:
On Sunday 25 Oct 2009 14:39:32 Shawn H Corey wrote:
> Michael Alipio wrote:
> > Any idea how to do this? I'm thinking maybe I can just
> > split the whole string and push each character into array,
> > then loop through the array, getting 3 elements set in the
> > proces..
> Split the string into an array, loop through it and use a slice to join
> the elements.

Why not use perldoc -f substr ( 
) in a loop? Alternatively one can use unpack but I'm not sure how well it 
would handle Unicode characters.


	Shlomi Fish

Shlomi Fish
First stop for Perl beginners -

Chuck Norris read the entire English Wikipedia in 24 hours. Twice.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About