Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created April 19, 2018 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/85b20f6df00e70273d5a5cb1b569263d to your computer and use it in GitHub Desktop.
Save Fhernd/85b20f6df00e70273d5a5cb1b569263d to your computer and use it in GitHub Desktop.
Remover caracteres de un texto. OrtizOL.
import re
texto = '\t OrtizOL Blog \n '
print(texto.strip())
print(texto.lstrip())
print(texto.rstrip())
print(texto.replace(' ', ''))
print(re.sub('\s+', ' ', texto))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment