|
|
|
|
|
| | |
| |
Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
|
|
Subject: |
Re: Trim text |
|
From: |
SI |
|
Date: |
2/9/2003 7:21:29 AM |
|
IP: |
80.225.40.64 |
You could use the Len() function in VBScript to limit the length of the text:
<%
Dim strText
strText = "My name is John Doe"
' Is the string longer than 15 character?
If Len(strText) > 15 Then
' It is, so trim it using the Left() function
strText = Left(strText, 15) & "..."
Response.Write "<td>" & strText & "</td>"
Else
' It isnt - so just output it
Response.Write "<td>" & strText & "</td>"
End If
%> |
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|