-
textdata:String = ((((((settings.contact_extra.split("\r\n").join("")).split("\t").join(" ")).split("\n").join("")).split("<p>").join("")).split("</p>").join("").split("<b>").join("")).split("</b>").join(""));
FlashApe » Huh?
Huh?
- March 7th, 2007
- 12:27 pm
5 People had this to say...
- chuck
- March 7th, 2007
- 1:34 pm
Gross. I get the gist of what it's meant to do, but eeeeew.
I think I should save this snippet to show to anyone who complains that regular expressions are hard to understand. A regex for this would be much more readable.
- Ben Nadel
- March 7th, 2007
- 1:38 pm
I can hardly read that... but it seems like the user is stripping out all white space (except for tabs) and some tags and then joining it back into one giant string with no line breaks... looks like a big bowl of 'wrong' to me ![]()
- John
- March 7th, 2007
- 1:46 pm
A convoluted way to remove all newline, carriage returns and html tags from a string?
- Keith Peters
- March 8th, 2007
- 4:15 am
that's pretty much what you have to do in as2 before. as3 has replace and regex. but i would never string them all together in a single line like that. ![]()
Whats the problem?
The brackets are unnecessary but split/join is an easy way to find/replace in a string.