在VBScript或ASP中,如何提取一段非HTML代码内容

来源:百度知道 编辑:UC知道 时间:2024/06/27 03:46:23
如:
<IMG height=197 src="http://www.51maibang.com/cn/image/news/44623102006163512_4.gif" width=550 align=middle border=0><BR><BR>    随着消费者保健意识的加强和日常消费需求的上升,中国功能饮料市场进入了新的发展阶段,功能饮料产业已成为中国饮料行业的亮点之一

我只想提取:随着消费者保健意识的加强和日常消费需求的上升,中国功能饮料市场进入了新的发展阶段,功能饮料产业已成为中国饮料行业的亮点之一。

如果用replace,它只会把如"<"等替换掉,不能替换"height"等字符,总不能让我用replace把所有HTML的代码全写一遍吧。

望高手指教。
Re:失落的糖果
看不懂。有能直接拿来用的代码吗?

我提供我自己定的一个函数你

function delhtml(strtemp)
if len(trim(strtemp))>0 then
strtemp=replace(strtemp,"<p>","[br]")
strtemp=replace(strtemp,"<P>","[br]")
strtemp=replace(strtemp,"</P>","")
strtemp=replace(strtemp,"<br>","[br]")
strtemp=replace(strtemp,"<BR>","[br]")
while instr(strtemp,"<")>0 and instr(strtemp,">")>0
pos=instr(strtemp,"<")
pos2=instr(strtemp,">")
killstr=mid(strtemp,pos,pos2-pos+1)
strtemp=replace(strtemp,killstr,"")
wend
strtemp=replace(strtemp,"[br]","<br>")
strtemp=replace(strtemp,"<br><br>","")
end if
delhtml=strtemp
end function

使用方法:
str="<IMG height=197 src='在VBScript或ASP中,如何提取一段非HTML代码内容 能否在vbscript中调用asp中定义的变量 自定义的OCX 在asp或HTM中怎么使用它的属性和方法?用vbscript??? VBSCRIPT与JAVASCRIPT在ASP中可以同时使用吗? ASP---vbscript中page的意思 editplus 中怎么新建 asp文件?(VBScript) asp中如何调用vbscript方法 asp中vbscript的问题,求助~ asp 网页中 VBscript 脚本的问题 asp中vbscript javascript的问题