Source Code:
(back to article)
string_with_whitespace = " This string has leading and trailing whitespace. " trimmed_string = string_with_whitespace.strip() print(trimmed_string) # Output: "This string has leading and trailing whitespace."
Result:
Report an issue