在传统的ASP删除重复值,我有下面的代码从字符串在传统的ASP
str=Request.Form("txt_str")
“txt_str”是一个传统的ASP形式的页面,我在下面输入值的文本框:
000-00001
000-00001
000-00001
000-00002
response.write str
因此STR将000-00001 000-00001 000-00001 000-00002
array = split(str,Chr(44))
if str <> "" then
x=empty
for i = 0 to ubound(array)
if array(i) <> "" then
array_2 = split(array(i),chr(13) & chr(10))
for j = 0 to ubound(array_2)
if array_2(j) <> "" then
if x=empty then
x= "'" & array_2(j) & "'"
else
x= x & ",'" & array_2(j) & "'"
end if
end if
next
end if
next
End if
response.write x
因此x将返回为 '000-00001', '000-00001', '000-00001', '000-00002'
我想删除重复值x和只显示其为:
X = '000-00001', '000-00002'
我怎样才能实现这个this.Any帮助将不胜感激。 感谢
绝对是一个清晰而且写得很好的回应。获得我的投票。 –