<?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: Snippets: trim spaces from a string with Javascript</title>
	<atom:link href="http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/</link>
	<description></description>
	<lastBuildDate>Wed, 14 Jul 2010 01:41:21 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jeff</title>
		<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/comment-page-1/#comment-611</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Tue, 05 May 2009 20:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.10voltmedia.com/blog/?p=20#comment-611</guid>
		<description>Actually Matt, the var keyword is not required unless you&#039;re concerned about variable name conflicts with newString within the global scope. If you&#039;re using unique names for your variables, this isn&#039;t an issue and the var keyword can be omitted.</description>
		<content:encoded><![CDATA[<p>Actually Matt, the var keyword is not required unless you&#8217;re concerned about variable name conflicts with newString within the global scope. If you&#8217;re using unique names for your variables, this isn&#8217;t an issue and the var keyword can be omitted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/comment-page-1/#comment-610</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 05 May 2009 19:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.10voltmedia.com/blog/?p=20#comment-610</guid>
		<description>Hi, you&#039;ll need to prefix newString with a var statement within the trimString function.  Currently &quot;newString&quot; is being created in the global (window) scope.

I too recommend returning the result of theString.replace instead of creating a single use variable.

Keep up the good stuff :)</description>
		<content:encoded><![CDATA[<p>Hi, you&#8217;ll need to prefix newString with a var statement within the trimString function.  Currently &#8220;newString&#8221; is being created in the global (window) scope.</p>
<p>I too recommend returning the result of theString.replace instead of creating a single use variable.</p>
<p>Keep up the good stuff <img src='http://www.10voltmedia.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeff</title>
		<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/comment-page-1/#comment-85</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Tue, 02 Dec 2008 08:03:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.10voltmedia.com/blog/?p=20#comment-85</guid>
		<description>@Clint Rutkas:
No particular reason. The new string var is just a carry-over from the single-line command before being wrapped in a function.</description>
		<content:encoded><![CDATA[<p>@Clint Rutkas:<br />
No particular reason. The new string var is just a carry-over from the single-line command before being wrapped in a function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clint Rutkas</title>
		<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/comment-page-1/#comment-84</link>
		<dc:creator>Clint Rutkas</dc:creator>
		<pubDate>Tue, 02 Dec 2008 06:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.10voltmedia.com/blog/?p=20#comment-84</guid>
		<description>why not just make it inline instead of creating a new string var?
&lt;code&gt;
function trimString(theString) {
 return theString.replace(/^\s+&#124;\s+$/g, &#039;&#039;);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>why not just make it inline instead of creating a new string var?<br />
<code><br />
function trimString(theString) {<br />
 return theString.replace(/^\s+|\s+$/g, '');<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mani Gandham</title>
		<link>http://www.10voltmedia.com/blog/2008/10/snippets-trim-spaces-from-a-string-in-javascript/comment-page-1/#comment-60</link>
		<dc:creator>Mani Gandham</dc:creator>
		<pubDate>Sun, 16 Nov 2008 02:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.10voltmedia.com/blog/?p=20#comment-60</guid>
		<description>Thanks for this handy piece of code!</description>
		<content:encoded><![CDATA[<p>Thanks for this handy piece of code!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
