0

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

4

1 に答える 1

4

使用str.endswith:

>>> 'with trailing space  '.endswith(' ')
True
>>> 'without trailing space'.endswith(' ')
False
于 2014-10-26T03:57:21.337 に答える