I am trying to write a function to check for trail whitespace, but not to remove the spaces. but i have no idea of how to do that. can somebody teach me?
thank you
I am trying to write a function to check for trail whitespace, but not to remove the spaces. but i have no idea of how to do that. can somebody teach me?
thank you
Using str.endswith
:
>>> 'with trailing space '.endswith(' ')
True
>>> 'without trailing space'.endswith(' ')
False