ASP代码首页文章标,限制字数代码

来源:百度知道 编辑:UC知道 时间:2024/06/02 05:06:13
<%if rs1("TitleFontColor")<>"" then Response.Write("<font style=""color:"&rs1("TitleFontColor")&""">"&rs1("Title")&"</font>") else Response.Write(""&rs1("Title")&"") end if%>

这段是代码,加什么才能标题只显示15个字符,多余的出现省略号?
正确答案在这里
http://zhidao.baidu.com/question/66162955.html

还是谢谢你们

<%if rs1("TitleFontColor")<>"" then Response.Write("<font style=""color:"&rs1("TitleFontColor")&""">"& len(rs1("Title"),15) &"</font>") else Response.Write(""& len(rs1("Title"),15) &"") end if%>

Mid(rs1("Title"),1,15)&".."

<%if rs1("TitleFontColor")<>"" if len(rs1("TitleFontColor"))<=15 then Response.Write("<font style=""color:"&rs1("TitleFontColor")&""">"&rs1("Title")&"</font>") else Response.Write(left(rs1("TitleFontColor"),15)&"...") end if end if%>