Sure. You can use System.Collections.Specialized.NameValueCollection . First,
split the string into an array of strings, by splitting on the "&"character.
Then loop through the array of strings, splitting each one on the "="
character, and adding a new Item to the Collection. Example:
string source = "this=that&these=those&them=Something Else";
NameValueCollection myValues = new NameValueCollection();
string[] aryStrings = source.Split(new char[] {'&']});
string[] nameAndValue;
foreach (string s in aryStrings)
{
nameAndValue = s.Split(new char[] {'='});
myValues.Add(nameAndValue[0], nameAndValue[1]);
}
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
<np*****@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I have a string with name value collections (i.e. &foo=1&foo2=2)
Can I convert this string to some kind of name/value collection so I
can access the values with something like :
params["foo"] = 1;
Thanks,