How to split string in equally long parts
Beni Cherniavsky
cben at techunix.technion.ac.il
Wed Apr 9 12:23:26 EDT 2003
Mike Rovner wrote on 2003-04-08:
> "Heiko Henkelmann" <heiko at hhenkelmann.de> wrote in message
> news:b6vd0e$i1b$01$1 at news.t-online.com...
> > I need to split a string into an array of equally long substrings, like
> > e.g.:
> >
> > '1234567890' -> ['12', '34','56','78','90']
> >
> > What is the most efficient way to do this?
> >
> > Heiko
>
> Task description is too vague.
>
Indeed, what exactly the OP wants when it doesn't divide precisely?
E.g. when the string is 257 characters long?
--
Beni Cherniavsky <cben at tx.technion.ac.il>
More information about the Python-list
mailing list