asp 从数据库读取两个字符串比较 留下不同的
有两个字符串, 比如 ss="1,2,3,4,5,11,17,109" bb="1,4,11,17" ww="2,3,5,109" 怎么获得 ww的值
满意回答
<% function ssIs(sa,sb) dim a(100) if sa="" or sb="" then ssIs="" exit function end if 'on error resume next sat=split(sa,",") sas=split(sb,",") 'if cstr(error.Number) then 'ssIs="输入非法" 'error.clear 'on error goto 0 'exit function 'end if for i=0 to ubound(sat) for j=0 to ubound(sas) if sat(i)=sas(j) then sat(i)="<!>" sas(j)="<!>" end if next next
ssIs=join(sat,",")&join(sas,",") ssIs=replace(ssIs,"<!>,","") end function ss="1,2,3,4,5,11,17,109" bb="1,4,11,17" response.write(ssIs(ss,bb)) ww=ssIs(ss,bb) %>
|