'函数名:gethtmlcontent'参数:no-->要取得的字符数, txtcontent-->要处理的字符串
'功能: 从字符串里截取n个带html的字符,现在的实现方法还不完善,过程是:从字符串里找各种控件的开始,然后依些分开,放到数组里,然后一个一个数组的加上来看看字符是否大于给定的字符如果是,那么,返回这个数组.
'作者:柳永法
'时间:2007-6-1 20:03 :)
function gethtmlcontent(no, txtcontent)
if len(txtcontent)<= no then
gethtmlcontent = txtcontent
exitfunction
endif
set re =new regexp
re.ignorecase =true
re.global =true
patrn ="<p|<br|<li|<table"
patrn = split(patrn,"|")
foreach p in patrn
re.pattern = p
txtcontent = re.replace(txtcontent,"||"& p )
next
txtcontent = split(txtcontent,"||")
foreach e in txtcontent
if len(s)>no thenexitfor
s = s + e
next
gethtmlcontent = s
endfunction
%>
如对本文有疑问, 点击进行留言回复!!
asp中Request.ServerVariables的参数集合
网友评论