C
C#2y ago
Bujju

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
Angius
Angius2y ago
You mean, you'd like to print them to console or something?
Bujju
Bujju2y ago
No, I need it as a string.
Angius
Angius2y ago
Join it with newline as a separator, then
Bujju
Bujju2y ago
How do I do that?
Angius
Angius2y ago
string.Join() And '\n' or Environment.NewLine
Bujju
Bujju2y ago
Thanks How would I make the list show both the Keys and the Values?
Angius
Angius2y ago
You can try .Select()ing the list into strings