问题描述
我有一个checlistbox,如:
文本 ------------- 值
一个-------------数字
两个----------------数值
三-------------数字
A ---------------字符
B ---------------字符
C ---------------字符
D ---------------字符
#--------------- SplChar
$ --------------- SplChar
%--------------- SplChar
从这些列表项(在列表中选择的那些项)中,我想构建如下内容:
案例:所有选定项目:
("一个",两个",三个")中的数字和("A","B","C"中的字符) ''D'')和(''#'',''$'',''%'')''中的SplChar
对于案例:随机选择说,一,三,#,$:
(('')","$ 3")中的数字和(``#'',''$'')中的SplChar"
对于案例:单个选择说,$:
"SplChar in(" $)"
我正在寻找 LINQ 来构建此字符串.
I have a checlistbox like :
Text-------------Value
One-------------Numeric
Two-------------Numeric
Three-----------Numeric
A---------------Character
B---------------Character
C---------------Character
D---------------Character
#---------------SplChar
$---------------SplChar
%---------------SplChar
From these list items,those items which are selected in the list, I want to build something like:
for Case:All Items Selected:
"Numeric in (''one'',''Two'',''Three'') and Character in (''A'',''B'',''C'',''D'') and SplChar in (''#'',''$'',''%'')"
for Case: Random Selection say, one, three,#,$:
"Numeric in (''one'',''Three'') and SplChar in (''#'',''$'')"
for Case: Single Selection say, $:
"SplChar in (''$'')"
I am looking for LINQ to build this string.
any help is appreciated.
推荐答案
这篇关于Linq需要的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!