| | |
collapse white space in string
Thread Solved |
Something like this should do:
python Syntax (Toggle Plain Text)
s = 'xxxxx - xxxxx' space = ' ' nospace = '' s = s.replace(space, nospace) print s # xxxxx-xxxxx
drink her pretty
•
•
Join Date: Mar 2007
Posts: 110
Reputation:
Solved Threads: 31
Python Syntax (Toggle Plain Text)
>>> s = 'XXXXX -\n\t XXXX' >>> ''.join(s.split()) 'XXXXX-XXXX' >>>
![]() |
Similar Threads
- javascript works in IE but not working in firefox (JavaScript / DHTML / AJAX)
Other Threads in the Python Forum
- Previous Thread: RE:Python path using Batch File
- Next Thread: Need a python tFTP open source class library
| Thread Tools | Search this Thread |
address aliased anydbm bash beginner bits calling casino changecolor class clear conversion convert corners count cturtle cursor curves definedlines dictionary digital dynamic dynamically events examples excel external file float format frange function gui handling hints homework i/o iframe import info input java line linux list lists loan loop matching mouse multiple number numbers output parsing path port prime programming projects py py2exe pygame python random rational raw_input recursion recursive scrolledtext searchingfile shebang signal singleton string strings subprocess table tails terminal text thread threading time tkinter tlapse tooltip tuple tutorial type ubuntu unicode urllib urllib2 valueerror variable web-scrape whileloop word wxpython






