相信积累的力量

python,string,strip,split,join,sub

http://stackoverflow.com/questions/1546226/the-shortest-way-to-remove-multiple-spaces-in-a-string-in-python

The   fox jumped   over    the log.
The fox jumped over the log.


" ".join(foo.split())
re.sub(patten, replace, str)

posted @ 2013-08-23 19:24  ThreeF  阅读(347)  评论(0编辑  收藏  举报

相信积累的力量