<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.refactormycode.com,2007:users1750</id>
  <link type="application/atom+xml" href="http://www.refactormycode.com/users/1750" rel="self"/>
  <title>rikkus</title>
  <updated>Thu Oct 08 19:58:12 -0700 2009</updated>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor337717</id>
    <published>2009-10-08T19:58:12-07:00</published>
    <title>[C#] On Comma separated string to Dictionary</title>
    <content type="html">&lt;p&gt;Do you mind me asking why you want each token mapped to its index?&lt;/p&gt;

&lt;pre&gt;line.Split(new[] {','}).Aggregate(new Dictionary&amp;lt;string, int&amp;gt;(), (d, s) =&amp;gt; { d[s] = d.Keys.Count + 1; return d; });&lt;/pre&gt;</content>
    <author>
      <name>rikkus</name>
      <email>rik@rikkus.info</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1063-comma-separated-string-to-dictionary/refactors/337717" rel="alternate"/>
  </entry>
</feed>

