<SCRIPT LANGUAGE="vbScript">
<!--
str="用户名:xxx<BR>密码:ddd"
str1="d"
function restr(str, str1)
if instr(str, str1) = 0 then exit function
restr = left(str, instr(str, str1) - 1 + len(str1))
end function
document.write restr(str, str1)
//-->
</SCRIPT>
<%
str="用户名:xxx<BR>密码:ddd"
for i=0 to len(str)
response.write instr(left(str,i),"<BR>")
if instr(left(str,i),"<BR>")>=1 then
response.write left(str,i)
exit for
end if
next
%>
text = "点击图片可将其插入文章内容中"
start = instr(text,"图片")+2
text = left(text,start)
博客展示了VBScript的代码应用,包含自定义函数restr用于截取字符串,还使用instr函数查找特定字符位置,结合left函数截取字符串,同时有在ASP中使用循环和instr查找特定标签并截取字符串的操作。
3633

被折叠的 条评论
为什么被折叠?



