Line-seperated list from KeyValuePair
I have a
KeyValuePair<string, string>
, and I would like to make a line-separated list like the following:
[Key]: [Value]
[Key]: [Value]
[Key]: [Value]
How could I do that?7 Replies
You mean, you'd like to print them to console or something?
No, I need it as a string.
Join it with newline as a separator, then
How do I do that?
string.Join()
And '\n'
or Environment.NewLine
Thanks
How would I make the list show both the Keys and the Values?
You can try
.Select()
ing the list into strings