限制显示字数问题

blackroses 2005-05-13 11:03:16
我将数据库中的字段fname读出来显示,可是有些太长了,我想规定显示20字,其他的用“...”代替,这怎么编写代码?
...全文
113 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
aspme 2005-05-13
  • 打赏
  • 举报
回复
strTitle = rs("字段")
if len(strTitle)>20 then strTitle = left(strTitle,20) + "..."
leo963258 2005-05-13
  • 打赏
  • 举报
回复
if len(rs("content"))>=20 then
response.write left(rs("content"),20)&"..."
else
response.write rs("content")
end if

28,391

社区成员

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

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