리눅스에서 파이썬 2.7의 모든 공백/탭/줄 바꿈을 제거하려고합니다. 공백/탭/줄 바꿈 - 파이썬
나는 일을해야하는이 쓴 :myString="I want to Remove all white \t spaces, new lines \n and tabs \t"
myString = myString.strip(' \n\t')
print myString
출력 :
I want to Remove all white spaces, new lines
and tabs
간단한 일이해야 할 것 같다, 그러나 내가 여기서 뭔가를 놓친 거지. 내가 뭔가 가져와야 할까? 이 관련 질문에 대한 답 밖으로
없음 말아야을 newlinesandtabs 없습니다. –
이 유용 할 수 있습니다. http://stackoverflow.com/questions/8928557/python-splitting-string-by-all-space-characters – newtover
이것은 [나를 공백으로 장식하는 방법 (탭 포함)]에서 나에게 도움이 되었습니까?] [1] s.strip S = ('\ t의 \ n \ r 일') [1] : http://stackoverflow.com/questions/1185524/how-to-trim-whitespace- including-tabs – stamat