Skip to content

Instantly share code, notes, and snippets.

@wila-diaz
Last active June 15, 2020 04:34
Show Gist options
  • Save wila-diaz/a5cc40d4f7b00844d434c93c0a2d1e78 to your computer and use it in GitHub Desktop.
Save wila-diaz/a5cc40d4f7b00844d434c93c0a2d1e78 to your computer and use it in GitHub Desktop.
Delete spaces in strings (python)
#unclean
phrase= " h e l l o "
#remove external spaces
phrase= phrase.strip()
#remove all spaces
phrase= phrase.replace(" ", "")
@wila-diaz
Copy link
Author

Clean your strings with these methods in python. Difference between strip and replace
fordelete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment