Skip to content

Instantly share code, notes, and snippets.

@paulohrpinheiro
Created December 10, 2015 20:08
Show Gist options
  • Select an option

  • Save paulohrpinheiro/fc2438629ccac5da804b to your computer and use it in GitHub Desktop.

Select an option

Save paulohrpinheiro/fc2438629ccac5da804b to your computer and use it in GitHub Desktop.
Tirando as quebras de linha
>>> a = "<h1>Titulo</h1>\n<br><p>paragrafo</p>\n<br>\n"
>>> print a
<h1>Titulo</h1>
<br><p>paragrafo</p>
<br>
>>> b = a.replace('\n','')
>>> b.replace('\r','')
'<h1>Titulo</h1><br><p>paragrafo</p><br>'
>>> print b
<h1>Titulo</h1><br><p>paragrafo</p><br>
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment