Q:

Is there an C# equivalent to the PHP function `parse_str`?

Is there an C# equivalent to the PHP function parse_str?
I couldn't find anything and wrote my own function but is there something in the C# framework?
public Dictionary<string, string> parse_str(string query) {

    Dictionary<string, string> data = new Dictionary<string, string>();

    foreach(string set in query.Trim('?').Split('&'))
        data.Add(set.Split('=')[0], set.Split('=').Length < 2 ? "" : set.Split('=')[1]);

    return data;
}​​​​​​

A:

I think you are looking for HttpUtility.ParseQueryString()

