how to remove <BR> using replace function?

Albert Leibbrandt albert at compuscan.co.za
Thu Feb 9 03:15:06 EST 2006



Rinzwind wrote:

>Works for me.
>
>  
>
>>>>txt = "an unfortunate <br> in the middle"
>>>>print txt.replace("<br>", "")
>>>>        
>>>>
>an unfortunate  in the middle
>  
>
>
>
>Though I don't like the 2 spaces it gives ;)
>
>  
>
so use regex and replace both the double spaces and the <br>

cheers
albert




More information about the Python-list mailing list