Last active
June 15, 2020 04:34
-
-
Save wila-diaz/a5cc40d4f7b00844d434c93c0a2d1e78 to your computer and use it in GitHub Desktop.
Delete spaces in strings (python)
This file contains hidden or 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
#unclean | |
phrase= " h e l l o " | |
#remove external spaces | |
phrase= phrase.strip() | |
#remove all spaces | |
phrase= phrase.replace(" ", "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clean your strings with these methods in python. Difference between strip and replace
