If you have the libertry to go the RegExp, it's much easier.
(Put everything you consider a linebreak in the brackets with [\r\n\f\v]

var lines:Array=myStr.replace(/[\r\n\f\v]/mig,"\n").split("\n");
trace(lines.length.toString());

Don't know if that's what you was talking about.
-- Keith H --


Danny Kodicek 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