限制字符输出,大于输出的以"..."显示.该怎么做?

no820824 2003-08-26 07:53:55
限制字符输出,大于输出的以"..."显示.该怎么做?

比如输出一篇文章的标题,只输出10个字,大与10个字的后面以...显示.

谢谢..
...全文
60 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
arcow 2003-08-26
  • 打赏
  • 举报
回复
if len(rs("title"))>10 then
response.write left(rs("title"),10) & "..."
else
response.write rs("title")
end if
vinceding 2003-08-26
  • 打赏
  • 举报
回复
if len(str)>15 then
response.write left(str,13) & "..."
else
response.write str
end if
ttt2 2003-08-26
  • 打赏
  • 举报
回复
if len(strContent)>10 then
response.write left(strContent,10) & "..."
else
response.write strContent
end if
pp4u 2003-08-26
  • 打赏
  • 举报
回复
dim result
result=left(str,10) & "..."
Primer2002cn 2003-08-26
  • 打赏
  • 举报
回复
if len(strContent)>10 then
response.write left(strContent,10) & "..."
else
response.write left(strContent,10)
end if

28,391

社区成员

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

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