|
|
|
|
|
| | |
| |
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|