Mapping from string "aa=bb" to Dictionary
Why not to use regular expression? Your task can be solved with this code:

var dictionary = Regex.Matches(tmp, "(?&lt;key&gt;.+)=(?&lt;value&gt;.+)")
                      .OfType&lt;Match&gt;()
                      .Where(m =&gt; m.Success)
                      .ToDictionary(m =&gt; m.Groups["key"].Value.Trim(),
                                    m =&gt; m.Groups["value"].Value.Trim());