CSDN博客

img saihoo

解决从XXX开始,屏蔽以后的字符串的三种方法

发表于2004/6/25 10:49:00  759人阅读

<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)

 

 

0 0

相关博文

我的热门文章

img
取 消
img