Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のリストがあります。
これらの文字列をカンマ区切りの 1 つの文字列に変換したいのですが、最初に文字 (@ 記号) を追加したいと考えています。最終結果は次のようになります。@alpha,@beta,@charlie,@delta
@alpha,@beta,@charlie,@delta
私が今持っているのは非LINQメソッドですが、「クリーン」ではないようです:
String.Concat("@", String.Join(",@", mylist));
string.Join(",", mylist.Select(s => "@" + s));