[Tutor] Help

Hugo Arts hugo.yoshi at gmail.com
Fri May 14 22:00:40 CEST 2010


On Fri, May 14, 2010 at 9:25 PM, Abhishek Mishra <ideamonk at gmail.com> wrote:
>
>>>> linear1 = ''.join(foo.split('\n'))
>>>> linear2 = foo.replace('\n','')
> ^^ these are the two ways in which you can linearize the input text by
> removing all  '\n'

+1 for the replace. More obvious, cleaner, more efficient.

Hugo


More information about the Tutor mailing list