<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>indeedle &#187; javascript functions</title>
	<atom:link href="http://indeedle.com/tags/javascript-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://indeedle.com</link>
	<description>blogging the indeedle way</description>
	<lastBuildDate>Thu, 26 Aug 2010 08:16:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>LTrim, RTrim and Trim JavaScript Functions</title>
		<link>http://indeedle.com/blog/2009/12/22/ltrim-rtrim-and-trim-javascript-functions/</link>
		<comments>http://indeedle.com/blog/2009/12/22/ltrim-rtrim-and-trim-javascript-functions/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 05:30:50 +0000</pubDate>
		<dc:creator>Cody</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript functions]]></category>

		<guid isPermaLink="false">http://indeedle.com/?p=36</guid>
		<description><![CDATA[These are some functions I]]></description>
			<content:encoded><![CDATA[<p>These are some functions I found online, and it drives me mad having to find them each time. I didn&#8217;t write these, but they&#8217;ve been passed around a lot. They&#8217;re useful if you need some basic JavaScript functions.</p>
<p><strong>Left Trim<br />
</strong>Pass it a string to trim and any characters that should be trimmed from the left. <strong>chars</strong> can be left empty to trim spaces.</p>
<pre class="brush: jscript;">function ltrim(str, chars) {
	chars = chars || &quot;\\s&quot;;
	return str.replace(new RegExp(&quot;^[&quot; + chars + &quot;]+&quot;, &quot;g&quot;), &quot;&quot;);
}</pre>
<p><strong>Right Trim</strong><br />
Works exactly the same as the left trim, just on the right.</p>
<pre class="brush: jscript;">function rtrim(str, chars) {
	chars = chars || &quot;\\s&quot;;
	return str.replace(new RegExp(&quot;[&quot; + chars + &quot;]+$&quot;, &quot;g&quot;), &quot;&quot;);
}</pre>
<p><strong>Trim</strong><br />
Combines the left &amp; right trim to have a full trim functions.</p>
<pre class="brush: jscript;">function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}</pre>
<hr />
<p><small>© 2008 - 2009 for <a href="http://indeedle.com">indeedle</a>. All rights are reserved. | For more information please visit <a href="http://indeedle.com">indeedle</a>. |
<a href="http://indeedle.com/blog/2009/12/22/ltrim-rtrim-and-trim-javascript-functions/">Permalink</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://indeedle.com/blog/2009/12/22/ltrim-rtrim-and-trim-javascript-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->