Thank you all who replied particularly Chris and Tim.
L.
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-12-05, Tim Chase <[EMAIL PROTECTED]> wrote:
> http://docs.python.org/lib/module-textwrap.html
>
> The Python library has already done all the heavy lifting--no
> need to re-invent the wheel.
Well no, clearly we need xwrap methods and a ctextwrap module. ;)
--
Neil Cerutti
--
http://mail
> In other words, the string should be split at every 10th possition but
> if the 10th character is space, then the string must be split at the
> nearest space before the 10th possition.
>
> It could be better explained if the length of split strings will be
> 20.
>
> S='this is just a random seq
On Dec 5, 1:46 pm, Johny <[EMAIL PROTECTED]> wrote:
> On Dec 5, 11:55 am, Chris <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Dec 5, 10:55 am, Johny <[EMAIL PROTECTED]> wrote:
>
> > > I have a string of a variable length and I need to split the string
> > > in strings of 6 characters .
> > > But if the 6
On Dec 5, 11:55 am, Chris <[EMAIL PROTECTED]> wrote:
> On Dec 5, 10:55 am, Johny <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I have a string of a variable length and I need to split the string
> > in strings of 6 characters .
> > But if the 6th character is not space then I must split the string
> > a
Johny wrote:
> I have a string of a variable length and I need to split the string
> in strings of 6 characters .
> But if the 6th character is not space then I must split the string
> at possition before the 6th character.
>
> For example:
> if the main string S is
>
> S='abcde fghc ijkl mnop
On Dec 5, 10:55 am, Johny <[EMAIL PROTECTED]> wrote:
> I have a string of a variable length and I need to split the string
> in strings of 6 characters .
> But if the 6th character is not space then I must split the string
> at possition before the 6th character.
>
> For example:
> if the main str
I have a string of a variable length and I need to split the string
in strings of 6 characters .
But if the 6th character is not space then I must split the string
at possition before the 6th character.
For example:
if the main string S is
S='abcde fghc ijkl mnop'
the result should be
abcde
fg