Copy link to clipboard
Copied
original text:
<P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
I need to: <br/>sample text1<br2>sample text2<br2>sample text3
can help me
Copy link to clipboard
Copied
Have you tried...
<br>sample text1<br>sample text2<br>sample text3
Copy link to clipboard
Copied
No
Is it possible.
Copy link to clipboard
Copied
Try.
What code are you using to assign this text to the textfield?
Copy link to clipboard
Copied
Thank you for Quick reply,
I have tried today whole day but no result. I will show one of my code.
Below code i am getting bouble break but i need only one break.
var reg:RegExp = /\<\/?P.*?\/?\>/igm;
var _m=messageField.htmlText
_m=_m.replace(reg, '<br/>');
trace(_m) // "<br/>sampletext1<br/><br/>sampletext2<br/><br/>sampletext3<br/>"
Copy link to clipboard
Copied
You are getting doublke breaks because your text is showing double breaks. Every <br/><br/> you see will break twice.
Copy link to clipboard
Copied
Mhybe what you want to do is to only replace the </P> <P ... > sequences with the <BR> tag instead of every tag with a P in it.
Copy link to clipboard
Copied
var reg:RegExp = /\<\/?P.*?\/?\>/igm;
var _m=messageField.htmlText//<P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
_m=_m.replace(reg, '<br/>');
trace(_m) // "<br/>sampletext1<br/><br/>sampletext2<br/><br/>sampletext3<br/>"
Iam getting double breaks i need only one break.
Copy link to clipboard
Copied
As I indicated in my last response you probably want to be replacing the apir of tags, not individual ones. change you regular expression to do that
Copy link to clipboard
Copied
I tried But no usefull.
Can give code.
Copy link to clipboard
Copied
What did you try? The following does what I said you should do...
var reg:RegExp = /\<\/P\>\<P.*?\/?\>/igm;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now