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.
我有一个包含数千个字符串的 C# 列表:
"2324343" "6572332" "45122" ...
我想用括号替换它们,所以它们看起来像
"(2324343)" "(6572332)" "(45122)" ...
我知道如何编写一个 for 循环并做到这一点,但我想知道是否有办法最好使用 LINQ 和 LAMBDA 表达式来做到这一点。我也愿意接受其他建议。
非常感谢!
var resultList = list.Select(x => string.Format("({0})", x)).ToList();