<?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>Flav36rs &#187; str_pad</title>
	<atom:link href="http://flav36rs.com/tag/str_pad/feed/" rel="self" type="application/rss+xml" />
	<link>http://flav36rs.com</link>
	<description>Just another technical blog</description>
	<lastBuildDate>Mon, 12 Sep 2011 16:56:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Simple jQuery string padding function</title>
		<link>http://flav36rs.com/2009/02/27/simple-jquery-string-padding-function/</link>
		<comments>http://flav36rs.com/2009/02/27/simple-jquery-string-padding-function/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 12:27:57 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[str_pad]]></category>

		<guid isPermaLink="false">http://sha.re.it/?p=142</guid>
		<description><![CDATA[I&#8217;ve written a very simple jQuery function to return a string padded to a specified length, similar to the php equivalent str_pad. $.strPad = function(i,l,s) { var o = i.toString(); if (!s) { s = '0'; } while (o.length < &#8230; <a href="http://flav36rs.com/2009/02/27/simple-jquery-string-padding-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a very simple <a href="http://jquery.com/" target="_blank">jQuery</a> function to return a string padded to a specified length, similar to the php equivalent <a href="http://uk2.php.net/manual/en/function.str-pad.php" target="_blank">str_pad</a>.</p>
<pre lang="javascript" line="1">$.strPad = function(i,l,s) {
	var o = i.toString();
	if (!s) { s = '0'; }
	while (o.length < l) {
		o = s + o;
	}
	return o;
};</pre>
<p>Example Usage:</p>
</pre>
<pre lang="javascript">$.strPad(12, 5); // returns 00012
$.strPad('abc', 6, '#'); // returns ###abc</pre>
<p>This version only supports left padding, which is why it is labelled as only a simple version <img src='http://flav36rs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://flav36rs.com/2009/02/27/simple-jquery-string-padding-function/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

