I am wondering if there is a simple and clean way (one line) to convert a long (IEnumerable) enum to one line (string) with LINQ?
thanks
If you want long (whole numbers?) Separated by commas, try:
string str = string.Join(", ", myLongs.Select(l => l.ToString()).ToArray());
Sounds like an assignment for aggregate / fold:
var longs = new long[] {3, 2, 1, 0}; var str = longs.Aggregate("", (s, l) => s + l); // str = "3210"
Although I'm not really sure what the question is.
String.Join(yourIEnumerable, yourDelimiter)