21 Nov 2009

python移除空格回车tab换行符

>>> s = """sdf;ajsdfk ;k;kkdjfkdfdf
sdfsdfdsfadls     sdfsdjfl
adfelj)_("""
>>> print ''.join(s.split())
sdf;ajsdfk;k;kkdjfkdfdfsdfsdfdsfadlssdfsdjfladfelj)_(
>>> 

No comments :

Post a Comment