落伍者站长论坛's Archiver

wrswrs 发表于 2008-6-4 13:59

asp比较字符串的问题

str1="高全"
str2="电脑应用高级全能专业"

把这两个字符串相比较,如果有都包含“高”和“全”就返回1,不包含返回0

asp如何实现,请高手帮忙,谢谢!

亦副觅 发表于 2008-6-4 14:59

:o

39cool 发表于 2008-6-4 18:20

[code]function chkstr(str1,str2)
        dim arr1,i
        chkstr = 1
        for i = 1 to len(str1)
                if instr(str2,mid(str1,i,1))<1 then
                        chkstr = 0
                        Exit For
                end if
        next
end function[/code]调用
chkstr("高全","电脑应用高级全能专业")

pxl8 发表于 2008-6-6 10:43

作个记号............

wrswrs 发表于 2008-6-6 11:11

感谢39cool ,呵呵,以后还多请教你的,哈哈!

3650798 发表于 2008-6-6 11:34

记号

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.