<?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: The power of String.prototype.split() &#8230; almost</title>
	<atom:link href="http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/</link>
	<description></description>
	<pubDate>Sat, 11 Oct 2008 00:55:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Anonymous</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-398288</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 26 Sep 2007 12:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-398288</guid>
		<description>&lt;strong&gt;&lt;em&gt;&lt;blockquote&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/em&gt;&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p><strong><em><br />
<blockquote><code></code><code></code></blockquote></em></strong></p>
<p></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Levithan</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-396477</link>
		<dc:creator>Steven Levithan</dc:creator>
		<pubDate>Tue, 25 Sep 2007 12:13:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-396477</guid>
		<description>This script fixes the &lt;a href="http://blog.stevenlevithan.com/archives/cross-browser-split" rel="nofollow"&gt;cross-browser JavaScript split()&lt;/a&gt; inconsistencies &#38; bugs.</description>
		<content:encoded><![CDATA[<p>This script fixes the <a href="http://blog.stevenlevithan.com/archives/cross-browser-split" rel="nofollow">cross-browser JavaScript split()</a> inconsistencies &amp; bugs.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-219065</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 06 Apr 2007 01:43:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-219065</guid>
		<description>Want to get hot and bothered about another IE split method issue? IE does not include empty values in the array it creates if a regex (rather than a string) is used as the delimiter.

However, I must admit that I prefer JScript's way of handling splits which contain capturing groups.</description>
		<content:encoded><![CDATA[<p>Want to get hot and bothered about another IE split method issue? IE does not include empty values in the array it creates if a regex (rather than a string) is used as the delimiter.</p>
<p>However, I must admit that I prefer JScript&#8217;s way of handling splits which contain capturing groups.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: SitePoint Blogs &#187; Microsoft making progress&#8230;</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-37429</link>
		<dc:creator>SitePoint Blogs &#187; Microsoft making progress&#8230;</dc:creator>
		<pubDate>Thu, 13 Jul 2006 17:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-37429</guid>
		<description>[...] So there I was looking for to put a name to the implementor this JScript &#8220;feature&#8221; and it seems Microsoft have come up with a better solution. ;) Tags: microsoft, youtube [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] So there I was looking for to put a name to the implementor this JScript &#8220;feature&#8221; and it seems Microsoft have come up with a better solution. ;) Tags: microsoft, youtube [&#8230;]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-37428</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Thu, 13 Jul 2006 17:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-37428</guid>
		<description>&lt;blockquote&gt;
Would I be right in assuming that you have shown us a simplified version of your original problem, since I cannot see a reason why you would want it to behave like this?
&lt;/blockquote&gt;

That's right. In general this is a useful feature for building simple parsers. In my case been playing with a port of SimpleTest's stack-based lexer into Javascript, so this was something buried fairly deep in the code.</description>
		<content:encoded><![CDATA[<blockquote><p>
Would I be right in assuming that you have shown us a simplified version of your original problem, since I cannot see a reason why you would want it to behave like this?
</p></blockquote>
<p>That&#8217;s right. In general this is a useful feature for building simple parsers. In my case been playing with a port of SimpleTest&#8217;s stack-based lexer into Javascript, so this was something buried fairly deep in the code.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: omnicity</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-33720</link>
		<dc:creator>omnicity</dc:creator>
		<pubDate>Wed, 28 Jun 2006 15:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-33720</guid>
		<description>Would I be right in assuming that you have shown us a simplified version of your original problem, since I cannot see a reason why you would want it to behave like this?</description>
		<content:encoded><![CDATA[<p>Would I be right in assuming that you have shown us a simplified version of your original problem, since I cannot see a reason why you would want it to behave like this?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Fenrir2</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-32398</link>
		<dc:creator>Fenrir2</dc:creator>
		<pubDate>Fri, 23 Jun 2006 17:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-32398</guid>
		<description>&lt;code&gt;irb(main):001:0&#62; s = "a:b:c"
=&#62; "a:b:c"
irb(main):002:0&#62; s.split /:/
=&#62; ["a", "b", "c"]
irb(main):003:0&#62; s.split /(:)/
=&#62; ["a", ":", "b", ":", "c"]&lt;/code&gt;</description>
		<content:encoded><![CDATA[<code>irb(main):001:0&gt; s = "a:b:c"
=&gt; "a:b:c"
irb(main):002:0&gt; s.split /:/
=&gt; ["a", "b", "c"]
irb(main):003:0&gt; s.split /(:)/
=&gt; ["a", ":", "b", ":", "c"]</code>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-32355</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Fri, 23 Jun 2006 15:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-32355</guid>
		<description>It seems like Daniel is correct (I'm no Java regex master)...

&lt;pre&gt;
&lt;code&gt;
import java.util.regex.*;

public class Split {
    public static void main(String args[]) throws Exception{
        Pattern splitter = Pattern.compile(&#34;(:)&#34;);
        String str = &#34;a:b:c&#34;;
        String [] pieces = null;
        pieces = splitter.split(str);
        for (int i = 0 ; i &#60; pieces.length ; i++) {
            System.out.println(pieces[i]);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

Results in;

&lt;pre&gt;
&lt;code&gt;
a
b
c

&lt;/code&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>It seems like Daniel is correct (I&#8217;m no Java regex master)&#8230;</p>
<pre>
<code>
import java.util.regex.*;

public class Split {
    public static void main(String args[]) throws Exception{
        Pattern splitter = Pattern.compile(&quot;(:)&quot;);
        String str = &quot;a:b:c&quot;;
        String [] pieces = null;
        pieces = splitter.split(str);
        for (int i = 0 ; i &lt; pieces.length ; i++) {
            System.out.println(pieces[i]);
        }
    }
}
</code></pre>
<p>Results in;</p>
<pre>
<code>
a
b
c

</code>
</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: jgandu</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-32342</link>
		<dc:creator>jgandu</dc:creator>
		<pubDate>Fri, 23 Jun 2006 14:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-32342</guid>
		<description>daniel_eastley, remember, split is based on a regular expression, not a string.
I don't have access to a Java compiler right now, but try this in Java:
"a:b:c".split("(:)");</description>
		<content:encoded><![CDATA[<p>daniel_eastley, remember, split is based on a regular expression, not a string.<br />
I don&#8217;t have access to a Java compiler right now, but try this in Java:<br />
&#8220;a:b:c&#8221;.split(&#8221;(:)&#8221;);</p>]]></content:encoded>
	</item>
	<item>
		<title>By: daniel_eastley</title>
		<link>http://www.sitepoint.com/blogs/2006/06/23/the-power-of-stringprototypesplit-almost/#comment-32304</link>
		<dc:creator>daniel_eastley</dc:creator>
		<pubDate>Fri, 23 Jun 2006 12:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1593#comment-32304</guid>
		<description>The Java String object handles split as follows:

&lt;code&gt;
"a:b:c".split(":") = {"a","b","c"};
&lt;/code&gt;

So who's in the wrong here? Personally, coming from a Java background I'd expect it to be handled the way it does in IE although a better solution would be to have an additional parameter to say whether the seperator is included in the output. Then everyone would be happy: :-)

&lt;code&gt;
"a:b:c".split(":",true) = {"a",":","b",":","c"};
"a:b:c".split(":",false) = {"a","b","c"};
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The Java String object handles split as follows:</p>
<code>
"a:b:c".split(":") = {"a","b","c"};
</code>
<p>So who&#8217;s in the wrong here? Personally, coming from a Java background I&#8217;d expect it to be handled the way it does in IE although a better solution would be to have an additional parameter to say whether the seperator is included in the output. Then everyone would be happy: :-)</p>
<code>
"a:b:c".split(":",true) = {"a",":","b",":","c"};
"a:b:c".split(":",false) = {"a","b","c"};
</code>]]></content:encoded>
	</item>
</channel>
</rss>
