asp中怎么比对两个字符串是否相同
答案:1 悬赏:30
解决时间 2021-01-19 18:18
- 提问者网友:记得曾经
- 2021-01-18 17:43
asp中怎么比对两个字符串是否相同
最佳答案
- 二级知识专家网友:山君与见山
- 2021-01-18 18:15
<%
MyStr1 = "abcd"
MyStr2 = "abcd"
MyComp = StrComp(MyStr1,MyStr2,1)
if MyComp=0 then
response.Write "一样"
else
response.Write "不一样"
end if
%>
也可以直接比较:
<%
MyStr1 = "abcd"
MyStr2 = "abcd"
if MyStr1 = MyStr2 then
response.Write "一样"
else
response.Write "不一样"
end if
%>
MyStr1 = "abcd"
MyStr2 = "abcd"
MyComp = StrComp(MyStr1,MyStr2,1)
if MyComp=0 then
response.Write "一样"
else
response.Write "不一样"
end if
%>
也可以直接比较:
<%
MyStr1 = "abcd"
MyStr2 = "abcd"
if MyStr1 = MyStr2 then
response.Write "一样"
else
response.Write "不一样"
end if
%>
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯