Python's string.whitespace is great:
>>> string.whitespace
'
x0bx0c
'
How do I use this with a string without resorting to manually typing in '|
|... etc for regex?
For example, it should be able to turn:
"Please
don't hurt x0b me."
into
"Please don't hurt me."
I'd probably want to keep the single spaces, but it'd be easy enough to just go string.whitespace[:-1] I suppose.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…