<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Flex doesn&#8217;t have a String#replaceAll()?</title>
	<atom:link href="http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/feed/" rel="self" type="application/rss+xml" />
	<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/</link>
	<description>Technologist, Consultant, Software Engineer, Entrepreneur and Musician</description>
	<lastBuildDate>Fri, 11 May 2012 12:50:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Natan Cabral</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4379</link>
		<dc:creator>Natan Cabral</dc:creator>
		<pubDate>Sun, 22 Jan 2012 08:25:39 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4379</guid>
		<description>VERY VERY THANK YOU SO MUCH!
Muito Obrigado mesmo!</description>
		<content:encoded><![CDATA[<p>VERY VERY THANK YOU SO MUCH!<br />
Muito Obrigado mesmo!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davis</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4336</link>
		<dc:creator>Davis</dc:creator>
		<pubDate>Mon, 12 Dec 2011 23:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4336</guid>
		<description>Also, if it&#039;s really that important, you could simply extend the String class and add a replaceAll method, but you would likely find that you will be wrapping the existing replace method which will imbed the replace string in a regular expression. This is interesting because at least in Java the String class can not be extended, and for good reason, it&#039;s immutable and thereby was declared final predominantly due to concepts such as serializing of object data. A remote VM must have a consistent contract of what a String object is and it&#039;s behaviors. However, Flex is probably not going to span over an enterprise solution, so this is moot and the String implementation can be extended. But to what purpose?</description>
		<content:encoded><![CDATA[<p>Also, if it&#8217;s really that important, you could simply extend the String class and add a replaceAll method, but you would likely find that you will be wrapping the existing replace method which will imbed the replace string in a regular expression. This is interesting because at least in Java the String class can not be extended, and for good reason, it&#8217;s immutable and thereby was declared final predominantly due to concepts such as serializing of object data. A remote VM must have a consistent contract of what a String object is and it&#8217;s behaviors. However, Flex is probably not going to span over an enterprise solution, so this is moot and the String implementation can be extended. But to what purpose?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davis</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4335</link>
		<dc:creator>Davis</dc:creator>
		<pubDate>Mon, 12 Dec 2011 23:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4335</guid>
		<description>I have to admit, given the number of languages which do provide this implementation, I was surprised at first that a replaceAll() method was not provided. However, I use regex frequently, so I simply implemented an old BSD regex pattern I used in Vi. One could argue that most interfaces in an API are wrapping redundant functionality, and therefore those functions/methods are not absolutely necessary. But the primary purpose of an API is to expedite the construction process. And to force someone to put on the regex hat to modify a string seems a bit confounding when a method could be provided which is self-documenting, therefore intuitive, therefore easy to implement. That and not all regex engines were created equally, though for this requirement they nearly all work the same I think. The word developer doesn&#039;t refer to someone who knows all there is to know, if that were true, there would be no such creature. Anyone who is reading this is a developer, they knew enough to research, and found a solution, whether they accept it or not.</description>
		<content:encoded><![CDATA[<p>I have to admit, given the number of languages which do provide this implementation, I was surprised at first that a replaceAll() method was not provided. However, I use regex frequently, so I simply implemented an old BSD regex pattern I used in Vi. One could argue that most interfaces in an API are wrapping redundant functionality, and therefore those functions/methods are not absolutely necessary. But the primary purpose of an API is to expedite the construction process. And to force someone to put on the regex hat to modify a string seems a bit confounding when a method could be provided which is self-documenting, therefore intuitive, therefore easy to implement. That and not all regex engines were created equally, though for this requirement they nearly all work the same I think. The word developer doesn&#8217;t refer to someone who knows all there is to know, if that were true, there would be no such creature. Anyone who is reading this is a developer, they knew enough to research, and found a solution, whether they accept it or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Micheal</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4326</link>
		<dc:creator>Micheal</dc:creator>
		<pubDate>Thu, 01 Dec 2011 12:03:15 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4326</guid>
		<description>Thanks..Really nice..</description>
		<content:encoded><![CDATA[<p>Thanks..Really nice..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Texas</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4314</link>
		<dc:creator>Texas</dc:creator>
		<pubDate>Tue, 22 Nov 2011 04:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4314</guid>
		<description>I wouldn&#039;t want to work with Josh.

Seriously though... I come from a decade of .NET and using String.Replace() to replace ALL occurrences of the string is very helpful. I got stuck in the side when I assumed AS3 behaved the same.

Oh well, I can adjust. The rest of AS3 is A-OK to me.</description>
		<content:encoded><![CDATA[<p>I wouldn&#8217;t want to work with Josh.</p>
<p>Seriously though&#8230; I come from a decade of .NET and using String.Replace() to replace ALL occurrences of the string is very helpful. I got stuck in the side when I assumed AS3 behaved the same.</p>
<p>Oh well, I can adjust. The rest of AS3 is A-OK to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: montana</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4312</link>
		<dc:creator>montana</dc:creator>
		<pubDate>Wed, 16 Nov 2011 01:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4312</guid>
		<description>I wouldn&#039;t want to work with Chris.</description>
		<content:encoded><![CDATA[<p>I wouldn&#8217;t want to work with Chris.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4122</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Tue, 07 Jun 2011 14:28:23 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4122</guid>
		<description>if you can even use a regexp    you should not call yourselfs developers... !!</description>
		<content:encoded><![CDATA[<p>if you can even use a regexp    you should not call yourselfs developers&#8230; !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thanker</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4116</link>
		<dc:creator>Thanker</dc:creator>
		<pubDate>Thu, 05 May 2011 14:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4116</guid>
		<description>thanks!</description>
		<content:encoded><![CDATA[<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4115</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Fri, 22 Apr 2011 20:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4115</guid>
		<description>My, what a fun thread this is to read...

Flex (ActionScript, actually) lets you use Regular Expressions for your search string.

Regular Expressions already have the /g modifier, which already means replace all. If you use this modifier in your expression, the replace function will replace all.

Regular Expressions are becoming the deFacto way to provide a powerful variety of search and replace algorithms.

Why should language architects reproduce all the functionality of RegEx with their own custom code?

For example, one could use the replace function as-is to replace any email in a string with the word [redacted]. That&#039;s how cool RegEx is. Or should they also provide a replaceEmailWith() function as well?

There are a wealth of resources out there to help one learn how to write RegEx. It&#039;s important to learn, not just for ActionScript, but to keep pace with the evolution of code in general.

All that said... your function IS a neat way to do the same thing.</description>
		<content:encoded><![CDATA[<p>My, what a fun thread this is to read&#8230;</p>
<p>Flex (ActionScript, actually) lets you use Regular Expressions for your search string.</p>
<p>Regular Expressions already have the /g modifier, which already means replace all. If you use this modifier in your expression, the replace function will replace all.</p>
<p>Regular Expressions are becoming the deFacto way to provide a powerful variety of search and replace algorithms.</p>
<p>Why should language architects reproduce all the functionality of RegEx with their own custom code?</p>
<p>For example, one could use the replace function as-is to replace any email in a string with the word [redacted]. That&#8217;s how cool RegEx is. Or should they also provide a replaceEmailWith() function as well?</p>
<p>There are a wealth of resources out there to help one learn how to write RegEx. It&#8217;s important to learn, not just for ActionScript, but to keep pace with the evolution of code in general.</p>
<p>All that said&#8230; your function IS a neat way to do the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: perfi</title>
		<link>http://colinharrington.net/blog/2008/07/flex-doesnt-have-a-stringreplaceall/comment-page-1/#comment-4077</link>
		<dc:creator>perfi</dc:creator>
		<pubDate>Mon, 21 Mar 2011 20:15:54 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/15/flex-doesnt-have-a-stringreplaceall/#comment-4077</guid>
		<description>hey all,

the replace all is needed in the sense that replace only replaces Once. so if you have multiple occurrences of the string you are trying to replace, it will not work.

Thanks for tip colin.</description>
		<content:encoded><![CDATA[<p>hey all,</p>
<p>the replace all is needed in the sense that replace only replaces Once. so if you have multiple occurrences of the string you are trying to replace, it will not work.</p>
<p>Thanks for tip colin.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

