本文介紹了是否有等效于 string.Join(string, string[]) 的 LINQ的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
有沒有辦法使用 LINQ 將一組對象轉換為單個新對象?
Is there any way to convert a collection of objects into a single new object using LINQ?
我想在另一個 LINQ to SQL 表達式中使用它.
I want to use this within another LINQ to SQL expression.
推薦答案
為什么不使用 string.Join
本身?
Why don't you use the string.Join
itself?
string.Join("<br/>", collection.Select(e => e.TextProp).ToArray());
這篇關于是否有等效于 string.Join(string, string[]) 的 LINQ的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!