对象Book
具有类型的Author
属性。Name
string
我想遍历所有作者并将其名称字符串添加到以逗号分隔的一个字符串(不是数组)中,因此该字符串应位于 as
string authorNames = "Author One, Author two, Author three";
string authorNames = string.Empty;
foreach(string item in book.Authors)
{
string fetch = item.Name;
??
}