What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-19 09:38:10
trim string python
string =' abc ' # After removing leading whitespace print(string.lstrip()); # Output: 'abc ' # After removing trailing whitespace print(string.rstrip()); # Output: ' abc' # After removing all whitespace print(string.strip()); # Output: 'abc' Add solution
Best helpers
Wayne
+5
Abe bubush
+5
Kyle Carlson
+5
Myles
+5
Takje
+5
Trevorj
+5
David
+5
Mitsos
+5
Nuraxi
+5
Ahmed Masud
+5