The fastest (execution, not writing) way would probably be to do your
own loop over the string and find all the positions of line breaks
(either \r or \n) and use just use substring to pull out the
individual lines.

If you do end up trying RegExes I'd be very interested in how you do
it.  The only regex library I've found for AS2 doesn't compile with
MTASC (looking at the code I don't know why anything would compile
it), which is causing me significant annoyance.  If you find one that
works with MTASC I'd love to know about it. :)

  -Andy

On 9/12/07, Danny Kodicek <[EMAIL PROTECTED]> wrote:
> I'm looking for a simple, reliable method for splitting a string into its
> constituent lines (at the hard line breaks - this isn't a text wrapping
> thing). The problem is that line breaks could be Chr(10) or Chr(13), or
> indeed both. I've done this:
> myArr =
> myStr.split(String.fromCharCode(10)).join(String.fromCharCode(13)).split(Str
> ing.fromCharCode(13))
>
> I'm guessing I'm better off going the RegEx route, but I was wondering if
> there's a quicker, simpler way.
>
> Danny
>
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to