Tuesday, November 5, 2013

Cast everything in a C# enum to a space separated string!

public static string Render()
{
   var values = Enum.GetValues(typeof(Fixture));
   string spool = values.Cast<object>().Aggregate("", (current, value) => current + value +
         " ");
   return spool.Trim();
}

No comments:

Post a Comment