关于类似
的转换问题

simonzheng1 2005-01-25 04:04:06
要将库中的数据以下格式数据:

以下信息<br>-----------------**<b><u>申请信息</u></b>**---------------<br><br>编号:<u>1065</u><br><br>

输出成:

以下信息
申请信息
编号:1065

该如何做呢,做好一个现成的函数。谢谢!
...全文
57 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
simonzheng1 2005-01-25
  • 打赏
  • 举报
回复
直接输出出来没问题,会有换行等格式输出,
但是假如放入到<textarea name="Detail" rows="13" cols="70"><%=str%></textarea>
时输出出来就还是
以下信息<br>-----------------**<b><u>申请信息</u></b>**---------------<br><br>编号:<u>1065</u><br><br>

怎么能做到让它在表单里也是正常的呢?谢谢!
sxsgssgs 2005-01-25
  • 打赏
  • 举报
回复
str="以下信息<br><b><u>申请信息</u></b><br><br>编号:<u>1065</u><br><br>"
sxsgssgs 2005-01-25
  • 打赏
  • 举报
回复
<%
function tabConvert(str)
dim tempstr
dim theStr
dim canConvert
dim theChr
tempStr=str
theChr=""
theStr=""
canConvert=1
for i=1 to len(tempStr)
theChr=mid(tempStr,i,1)
if theChr="<" then
canConvert=0
end if
if theChr=">" then
canConvert=1
end if
if theChr=" " and canConvert=1 then
theChr= " "
end if
theStr=theStr&theChr
next
theStr=replace(theStr,chr(13),"<br>")
tabConvert=theStr
End function
%>
str="以下信息<br>-----------------**<b><u>申请信息</u></b>**---------------<br><br>编号:<u>1065</u><br><br>"
response.write tabConvert(str)
simonzheng1 2005-01-25
  • 打赏
  • 举报
回复
说详细点好吗?谢谢!
myvicy 2005-01-25
  • 打赏
  • 举报
回复
ubb吧。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧