Python Trim Whitespace

July 23, 2018
s = s.strip()

NOTE: left strip lstrip and right strip rstrip are available as well.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.