How do I remove whitespace from the end of a string in Python?

后端 未结 2 659
孤城傲影
孤城傲影 2020-12-04 17:36

I need to remove whitespaces after the word in the string. Can this be done in one line of code?

Example:

string = \"    xyz     \"

desired result :         


        
2条回答
提交回复
热议问题