这是我的清单:
我需要一个具有以下返回值的方法:
如您所见,结果中的每个字符串首尾都需添加引号
List<string> elements = new List<string> { "apple", "orange", "peach" };
我需要一个具有以下返回值的方法:
string result = "'apple', 'orange', 'peach'";
如您所见,结果中的每个字符串首尾都需添加引号
"'"
,然后用", "
连接。那么您有什么快速、流畅的建议吗?请考虑性能问题,因为此列表可能包含大量元素,您怎么看待这一点?
Where Name in ('apple', 'orange', 'peach')
。 - Saeid