I\'m writing a method which, let\'s say, given 1
and hello
should return http://something.com/?something=1&hello=en
.
I
Here's my version (needs .NET4 or a ToArray() call on the Select)
var items = new Dictionary { { "Name", "Will" }, { "Age", "99" }};
String query = String.Join("&", items.Select(i => String.Concat(i.Key, "=", i.Value)));
I thought the use of Dictionary might mean the items can get reordered, but that doesn't actually seem to be happening in experiments here - not sure what that's about.