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
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5