View Single Post
Old 06-01-2011, 08:01 AM  
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
Actionscript Guru I need your help.

can someone explain to me why this function doesn't replace "<![CDATA[" in the string s ?

Code:
public static function trim(s:String):String {
	s = s.replace(/&lt;![CDATA[/g, "");
	s = s.replace(/<![CDATA[/g, "");
	s = s.replace(/]]&gt;/g, "");
	s = s.replace(/]]>/g, "");
	s = s.replace(/^([\s|\t|\n]+)?(.*)([\s|\t|\n]+)?$/gm, "$2");
	return s;
}
I'm kind of out of ideas...
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote