Off the top of my head, try /$\s*^/g
-Josh
On Tue, Jun 17, 2008 at 3:55 PM, Luke Vanderfluit <
[EMAIL PROTECTED]> wrote:
> Hi.
>
> Now that Ive solved the textarea linebreak problem (with Josh's help,
> thanks Josh), my
> next problem arises...
>
> How do I capture a line break in flex.
>
> I capture the text that's been put in the textarea with linebreaks and all,
> but now I want
> to replace the linebreaks..
>
> Ive tried this:
>
> <mx:Script>
> <![CDATA[
> private function saveThis():void {
> var s1:String = foo.text;
> var myp:RegExp = /\n/g;
> s1 = s1.replace(myp,"FA");
> if (s1.indexOf("\n") > -1) {
> bar.text = "yes" + s1;
> } else {
> bar.text = "no" + s1;
> }
> }
> ]]>
> </mx:Script>
>
> <mx:TextArea id="bar" width="100" height="100"/>
> <mx:TextArea id="foo" width="200" height="200" wordWrap="true"/>
> <mx:Button label="GO" horizontalCenter="0" top="10" click="saveThis()"/>
>
> Thanks in advance.
>
> Kr.
> Luke.
>
> --
> Luke Vanderfluit
> Analyst / Web Programmer
> e3Learning.com.au
> 08 8221 6422
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]