I'm working with a dictionary of type <string,string> like this:
Dictionary<string, string> parameters = new Dictionary<string, string>()
{
{"llave1", "valor1"},
{"llave2", "valor2"},
{"llave3", "valor3"},
{"llave4", "valor4"}
};
I want to get a string like this:
"llave1=valor1&llave2=valor2&llave3=valor3&llave4=valor4"
to solve this problem I made this:
foreach (var element in parameters)
{
strParameters += element.Key + "=" + element.Value;
if (index < parameters.Count)
{
strParameters += "&";
index++;
}
}
I wanted to know any way to get the same string result but using linq or String.Join I'm trying to refactory my code