 <p>Have a look at the <a href="http://msdn.microsoft.com/en-us/library/system.string.split.aspx" rel="nofollow"><code>String.Split()</code> function</a>, it tokenises a string based on an array of characters supplied.</p> <p>e.g.</p> <pre><code> string[] lines = text.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries); </code></pre> <p>now loop through that array and split each one again</p> <pre><code>foreach(string line in lines) { string[] pair = line.Split(new[] {':'}); string key = pair[0].Trim(); string val = pair[1].Trim(); .... } </code></pre> <p>Obviously check for empty lines, and use <code>.Trim()</code> where needed...</p> <p>[EDIT] <strong>Or alternatively as a nice Linq statement...</strong></p> <pre><code>var result = from line in text.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries) let tokens = line.Split(new[] {':'}) select tokens; Dictionary&lt;string, string&gt; = result.ToDictionary (key =&gt; key[0].Trim(), value =&gt; value[1].Trim()); </code></pre>