My question is very similar to Convert a delimted string to a dictionary<string,string> in C#, except instead of Dictionary<String, String>
, I want List<KeyValuePair<String, String>>
(in my case order of those key-value pairs is important)
So, to rephrase my problem:
I have a string in the following format "key1=value1;key2=value2;key3=value3"
. I need to convert it to a List<KeyValuePair<String, String>>
for the above mentioned key value pairs.
I can do this without using LINQ, but can this be done using LINQ? and how?