【发布时间】:2016-01-28 10:15:21
【问题描述】:
我有这个数组:
我需要从字符串上方的数组中生成一个这样的字符串:
(export_sdf_id=3746) OR (export_sdf_id=3806) OR (export_sdf_id=23) OR (export_sdf_id=6458) OR (export_sdf_id=3740) OR (export_sdf_id=3739) OR (export_sdf_id=3742)
知道实现它的优雅方式是什么吗?
【问题讨论】:
-
什么定义了是否使用不同的数组位置?
-
您是否尝试过搜索?请阅读How to Ask。
-
为什么有人投票重新开放?这个问题之前已经被问过数千次了,这个问题不符合How to Ask 中的指导方针。没有研究显示。
-
这里是正确答案
string result = String.Join(" OR ", idsArr.Select(x => '(' + x + ')')); -
@Mark this one 怎么样?