My initialization is:
List<string> convertedList = new List<string>();
List<KeyValuePair<string, int>> originalList = new List<KeyValuePair<string, int>>();
And I basically want to populate convertedList with only the string values in originalList
So if originalList has some items: ["foo",5],["bar",16],["baz",100],
I want convertedList to contain: ["foo"],["bar"],["baz"]
So far I’ve tried:
for (int i = 0; i <= originalList.Count; i++)
{
convertedList.Add(actions.ToString());
}
but with no luck.
Oh, and keep in mind that I’m a newbie and the answers to this might be really obvious.
Thanks for helping me out!
And how would I go about proceeding if I want to convert only the first X items?
Or: