Advertisement
Fhernd

remover-caracteres.py

Apr 19th, 2018
2,972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import re
  2.  
  3. texto = '\t    OrtizOL Blog   \n  '
  4.  
  5. print(texto.strip())
  6.  
  7. print(texto.lstrip())
  8.  
  9. print(texto.rstrip())
  10.  
  11. print(texto.replace(' ', ''))
  12.  
  13. print(re.sub('\s+', ' ', texto))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement