<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Replacing Strings in AS3</title>
	<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/</link>
	<description>Actionscript Tutorials and Articles for AS3 and AS2 by Rob Gungor.</description>
	<pubDate>Mon, 06 Sep 2010 14:59:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3</generator>
		<item>
		<title>By: mnbmbnm</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-116</link>
		<dc:creator>mnbmbnm</dc:creator>
		<pubDate>Wed, 14 May 2008 08:29:32 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-116</guid>
		<description>mnm
nbmbnmbnmnbmnb
bnm</description>
		<content:encoded><![CDATA[<p>mnm<br />
nbmbnmbnmnbmnb<br />
bnm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-11</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 11 Oct 2007 05:56:23 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-11</guid>
		<description>Hi,

Can I ask what is the fastest way in AS3 to change an array from var array1 = [1, 2,  3,  4,  5]
to  var array1 = [1&#38;2&#38;3&#38;4&#38;5] 

I would think it would be array1.join("&#38;") but having trouble.
thanks for any help.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can I ask what is the fastest way in AS3 to change an array from var array1 = [1, 2,  3,  4,  5]<br />
to  var array1 = [1&amp;2&amp;3&amp;4&amp;5] </p>
<p>I would think it would be array1.join(&#8221;&amp;&#8221;) but having trouble.<br />
thanks for any help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Field</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-10</link>
		<dc:creator>Andrew Field</dc:creator>
		<pubDate>Wed, 10 Oct 2007 21:55:41 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-10</guid>
		<description>Just to add - (perhaps you could merge the two comments?) - the above code used to work well, but it is just so satisfying to find a one line solution to replace it.  Thank you!</description>
		<content:encoded><![CDATA[<p>Just to add - (perhaps you could merge the two comments?) - the above code used to work well, but it is just so satisfying to find a one line solution to replace it.  Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Field</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-9</link>
		<dc:creator>Andrew Field</dc:creator>
		<pubDate>Wed, 10 Oct 2007 21:54:25 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-9</guid>
		<description>Just a quick word of thanks - I've been looking for a 'quick' solution for about the past hour.  This brilliantly simple solution is exactly what I needed.

Finally, no messing about with code like: 
&lt;code&gt;String.prototype.replace = function() 
{
var arg_search, arg_replace, position; 
var endText, preText, newText; 
arg_search = arguments[0];
arg_replace = arguments[1];
if(arg_search.length==1) return this.split(arg_search).join(arg_replace);
position = this.indexOf(arg_search); 
if(position == -1) return this; 
endText = this; 
do 
{ 
position = endText.indexOf(arg_search); 
preText = endText.substring(0, position) 
endText = endText.substring(position + arg_search.length) 
newText += preText + arg_replace; 
} while(endText.indexOf(arg_search) != -1) 
newText += endText; 
return newText; 

} &lt;/code&gt;

Brilliant - thank you!</description>
		<content:encoded><![CDATA[<p>Just a quick word of thanks - I&#8217;ve been looking for a &#8216;quick&#8217; solution for about the past hour.  This brilliantly simple solution is exactly what I needed.</p>
<p>Finally, no messing about with code like: </p>
<div class="codesnip-container" >String.prototype.replace = function()<br />
{<br />
var arg_search, arg_replace, position;<br />
var endText, preText, newText;<br />
arg_search = arguments[0];<br />
arg_replace = arguments[1];<br />
if(arg_search.length==1) return this.split(arg_search).join(arg_replace);<br />
position = this.indexOf(arg_search);<br />
if(position == -1) return this;<br />
endText = this;<br />
do<br />
{<br />
position = endText.indexOf(arg_search);<br />
preText = endText.substring(0, position)<br />
endText = endText.substring(position + arg_search.length)<br />
newText += preText + arg_replace;<br />
} while(endText.indexOf(arg_search) != -1)<br />
newText += endText;<br />
return newText; </p>
<p>}</p></div>
<p>Brilliant - thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Gungor</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-7</link>
		<dc:creator>Rob Gungor</dc:creator>
		<pubDate>Tue, 09 Oct 2007 20:02:45 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-7</guid>
		<description>Thanks Justin!</description>
		<content:encoded><![CDATA[<p>Thanks Justin!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-5</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Tue, 09 Oct 2007 19:53:07 +0000</pubDate>
		<guid>http://www.iheartactionscript.com/replacing-strings-in-as3-split-and-splitjoin-so-nice/#comment-5</guid>
		<description>There is a way to check strings using regular expressions too I believe. For example, if you need to check if the first 5 characters in a string are "hello" for example:

var myString:String = "hello there";
var parts:Array = myString.match(/[a-z]{5}/g);
trace(parts[0]) // hello</description>
		<content:encoded><![CDATA[<p>There is a way to check strings using regular expressions too I believe. For example, if you need to check if the first 5 characters in a string are &#8220;hello&#8221; for example:</p>
<p>var myString:String = &#8220;hello there&#8221;;<br />
var parts:Array = myString.match(/[a-z]{5}/g);<br />
trace(parts[0]) // hello</p>
]]></content:encoded>
	</item>
</channel>
</rss>
