ASP求判断文章中出现第2次</p>的时候后面写点东西。 请给代码,在线等。

来源:百度知道 编辑:UC知道 时间:2024/07/04 02:19:54
ASP想判断文章中出现第2次</p>的时候后面写点东西。 请给代码,在线等
如果我想在第6个</p>的时候后面写点东西。呢?

replace("字符串","</p>","</p>新字符串",instr("字符串","</p>")+1,1,1)

或者
replace(replace(replace("字符串","</p>","</p>$$",1,2,1),"</p>$$","</p>",1,1,1),"</p>$$","</p>新字符串")

第六个:
replace(replace(replace("字符串","</p>","</p>$$",1,6,1),"</p>$$","</p>",1,5,1),"</p>$$","</p>新字符串")

<%
content="....."
if inStr(content,"</p>")>1 then
g_num=Split(content,"</p>")
for i=0 ubound(len(g_num))
if i=1 then
response.write g_num(1)&"你要写的内容"
elseif i=5 then
response.write g_num(5)&"你要写的内容"
end if

next
end if
%>