Remove Leading And Trailing Whitespace From A Python String With .strip()
Calling `.strip()`` on a string removes both leading and trailing whitespace (including newline characters)
Code
original = """
alfa bravo charlie
"""
stripped = original.strip()
print(f"START|{stripped}|END")
Results
START|alfa bravo charlie|END