可能是个基础的问题,100分求答
多选框 入录记录后 name字段选择了 AA BB CC,三个人
显示出来的记录为 AA,BB,CC
如何才能显示出3条记录呢,分别为AA BB CC
------解决方案--------------------老大,你是不是从来都没有说清楚去主题?麻烦你把表结构以及想得出的结果写一下
------解决方案--------------------如果相邻的情况下
JavaScript:
var ss = "Is is the cost of of gasoline going up up?.\n ";
var re = /\b([a-z]+) \1\b/gim; //创建正则表达式样式.
var rv = ss.replace(re, "$1 "); //用一个单词替代两个单词.
最接近的等价VBScript 代码如下:
Dim ss, re, rv
ss = "Is is the cost of of gasoline going up up?. " & vbNewLine
Set re = New RegExp
re.Pattern = "\b([a-z]+) \1\b "
re.Global = True
re.IgnoreCase = True
re.MultiLine = True
rv = re.Replace(ss, "$1 ")
——摘自《JavaScript 语言参考》
建议LZ看一下正则,不相邻的情况自己想吧(反正俺是不会)。
------解决方案--------------------结合楼上的方法将查询出来的结果存入数组
可参考下面的去掉重复
<%
dim a(5),count,resoult(),resoult_count
a(0) = "aaa "
a(1) = "bbb "
a(2) = "bbb "
a(3) = "ccc "
a(4) = "ccc "
a(5) = "bbb "
ReDim Preserve resoult(0)
resoult(0)=a(0)
resoult_count=0
for i= 1 to ubound(a)
count=0
tmp=a(i)
for j=0 to ubound(resoult)
if tmp=resoult(j) then
count=count+1
end if
next
if count=0 then
resoult_count=resoult_count+1
ReDim Preserve resoult(resoult_count)
resoult(resoult_count)=tmp
end if
next
for i=0 to ubound(resoult)
response.write i& "re: "&resoult(i)& " <br> "
next
%>