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.
我有以下列表:
我想将这些字符串变成一个字符串,用逗号分隔,但我想先给它们添加一个字符(@ 符号)。最终结果应该是:@alpha,@beta,@charlie,@delta
@alpha,@beta,@charlie,@delta
我现在拥有的是一种非 LINQ 方法,但它看起来并不“干净”:
String.Concat("@", String.Join(",@", mylist));
string.Join(",", mylist.Select(s => "@" + s));