Created
July 8, 2019 20:09
-
-
Save eyaltrabelsi/847a37631a7ff81f2f7c1643a3422091 to your computer and use it in GitHub Desktop.
Removing useless characters on the end/start/both of you string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> name = "//George//" | |
>>> name.strip("/") | |
'George' | |
>>> name.rstrip("/") | |
'//George' | |
>>> name.lstrip("/") | |
'George//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment