I'm trying to convert an IEnumerable<int>
to a string in the format #,#,#,..
. I'm having a terrible time attempting to make a method of this. What is a quick and easy way to handle?
Thanks.
Use String.Join
:
string result = string.Join(",", enumerable);
Are you talking about something like:
string.Join(",", e.Select(i=>i.ToString()).ToArray());
i.e., concatenating an enumerable of int
s (e
in this case)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With