Come posso eliminare delle righe vuote da una stringa?

es

input = testo
testo




testo

testo


output =testotestotestotesto

ciao grazie!!!