Sometimes we may need to Trim String, whitespace characters from the left side, right side, or both sides of a string.
For this purpose Python provides three methods to Trim String.
code
code = ' Code, source '
code.strip()
print(f'After Trimming Whitespaces String =\'{code.strip()}\'')
#python #snippets #python trim string example