<?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"
	>
<channel>
	<title>Comments on: How Not To Remove Multiple Spaces From Strings</title>
	<atom:link href="http://bobondevelopment.com/2008/07/26/how-not-to-remove-multiple-spaces-from-strings/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobondevelopment.com/2008/07/26/how-not-to-remove-multiple-spaces-from-strings/</link>
	<description>Musings on the craft and business of software development</description>
	<pubDate>Mon, 01 Dec 2008 16:00:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Rory Fitzpatrick</title>
		<link>http://bobondevelopment.com/2008/07/26/how-not-to-remove-multiple-spaces-from-strings/#comment-6054</link>
		<dc:creator>Rory Fitzpatrick</dc:creator>
		<pubDate>Sun, 27 Jul 2008 12:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/?p=125#comment-6054</guid>
		<description>A useful tip, thanks for sharing. But would the following regex not work as well, as it can match 2 or more spaces?
&lt;code&gt;[\s]{2,}&lt;/code&gt;

I guess from a performance perspective a simple string comparison and replace might be more effective.

&lt;em&gt;Bob repies:  I use regex all the time, but tend to avoid regex when a simple comparison will do.  Not only for performance reasons, but for clarity.  But the main motivation for this post was running across this logic for the umpteenth time.  I know the intent, but it's one of those sneaky things that, depending on the data being fed to it, is apt to work most of the time and then occasionally fail.  That is the worst class of bugs.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>A useful tip, thanks for sharing. But would the following regex not work as well, as it can match 2 or more spaces?<br />
<code>[\s]{2,}</code></p>
<p>I guess from a performance perspective a simple string comparison and replace might be more effective.</p>
<p><em>Bob repies:  I use regex all the time, but tend to avoid regex when a simple comparison will do.  Not only for performance reasons, but for clarity.  But the main motivation for this post was running across this logic for the umpteenth time.  I know the intent, but it&#8217;s one of those sneaky things that, depending on the data being fed to it, is apt to work most of the time and then occasionally fail.  That is the worst class of bugs.</em></p>
]]></content:encoded>
	</item>
</channel>
</rss>
