Converting Generic Lists to Strings using C#
Posted on 2006-11-29
Let's say I have two generic lists: one is a g-list of integers (List<int>) and the other is of a custom class (List<StoredProcedureInfo>). First, I want to convert the list of integers to a comma-delimited string:
List<int> integerList = new List<int>();
// How do I retrieve the values in [integerList] as a comma-delimited string?
Let's say my custom class, StoredProcedureInfo, has four properties: ID (int), Name (string), Text (string), Checked (bool). Is there an easy way to get all of the ID property values in List<StoredProcedureInfo> as a comma-delimited string?
-= DeathToSpam =-