Print Page | Close Window

Show first few lines of text in form

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=28988
Printed Date: 28 March 2026 at 2:20pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Show first few lines of text in form
Posted By: Andy Rowland
Subject: Show first few lines of text in form
Date Posted: 29 November 2010 at 12:11pm
How do I show the first few lines of text in a form and have a read more link at the side.
ASP



Replies:
Posted By: Scotty32
Date Posted: 13 December 2010 at 8:13pm

Do you mean trim a string down?

You could do something like this:

<%

Dim strMessage

strMessage = "Hello World. Hello World. Hello World. Hello World. Hello World."
if len(strMessage) > 30 then strMessage = mid(strMessage, 1, 30) & "..."
Response.Write( strMessage )

%>


This quick code sample will shorten the string if it is larger than 30 characters to 30 characters and add "..." to the end.

Change the both of the number 30s above to your desired length



-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net