关于split,急!

gzcat 2005-09-15 12:24:05

ALLS="1,2,3,4,5"
想在asp中实现,当S有1时,输出"已有",否则输出"未有".


以下是我写的,帮我看看
<%
S=split(ALLS,",",-1)
for i=0 to UBound(S)
if S(i)=1 then
response.write "已有"
else
response.write "未有"
end if
next
%>
...全文
108 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
八哥 2005-09-15
  • 打赏
  • 举报
回复
if left(alls,2)="1," or instr(alls,",1,")<> 0 or right(instr,2)= ",1" then
response.write "已有"
else
response.write "未有"
end if

如果你非得用SPLIT
S=split(ALLS,",")
str= "没有"
for i=0 to UBound(S)
if S(i)=1 then
str= "已有"
exit for
next
response.write str
  • 打赏
  • 举报
回复
<%
S=split(ALLS,",")
for i=0 to UBound(S)
if S(i)=1 then
response.write "已有"
else
response.write "未有"
end if
next
%>
多了-1
jim.ma 2005-09-15
  • 打赏
  • 举报
回复
ALLS="1,2,3,4,5"
sc="未有"
S=split(ALLS,",")
for i=0 to UBound(S)
if cstr(S(i))=cstr(1) then sc="已有"
next
response.write sc
如果是这个基本目的话

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧