I have a String like below
<P><STRONG>Hi Bold</STRONG></P>
<P><U>Hi Underline</U></P>
<P><STRONG><EM>Hi Bold Italic</EM></STRONG></P>
<P><STRONG><FONT color=3D#8080ff>Hi Bold Purple</FONT></STRONG></P>
<P><IMG style=3D"HEIGHT: 152px; WIDTH: 203px" border=3D0 hspace=3D0 al=
t=3D"Inline Image with alt" src=3D"cid:/Downloads/axie_generated(1).pn=
g" width=3D1198 align=3Dbaseline height=3D900></P>
<P><IMG style=3D"HEIGHT: 183px; WIDTH: 188px" border=3D0 hspace=3D0 al=
t=3D"" src=3D"cid:/Desktop/potato.gif" width=3D495 align=3Dbaseline he=
ight=3D497></P>
<UL>
<LI>List Item</LI>
<LI><FONT color=3D#8080ff>List Item Purple</FONT></LI></UL>
<P><FONT color=3D#000000>Stream <A href=3D"https://open.spotify.com/tr=
ack/42DD4cLqkprJPih3YxXkAO?si=3Dc68ba6d1617d488d">Forever Rain</A></FO=
NT></P>
If the line is too long it will break into a new line with =n
. How can I remove and join the string back into one line without removing the other wanted =
in the String?
I have tried replaceAll('=n', '')
which does nothing and I have also tried replaceAll('n', '')
which successfully remove the newline but the =
is still there. If I proceed with replaceAll('=', '')
then it will remove all the =
including the ones that I want to keep
2
Answers
I have figured out the problem. It was because
r
is also present in the String. Therefore, usingreplaceAll('=rn', '')
helps me to solve itThat’s strange: I just ran this in a DartPad
and the output looks just as imagined, with no ‘=’ or ‘n’