Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2004, 01:52 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default pick apart text

Hi,

I would like to know how to do this, I have this big text stored in a db, but when I get the info back, I wan't to be able to spread it out, and make it look nicer by section, I need to enter a special char, like '\n' or something, that would identify the end of the section, and allow me to display just that part, then move along to the next one... does anyone have any ideas how to do it


 
Old March 7th, 2004, 09:33 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If the text is being stored with hard returns, all you need is to do a simple search and replace of vbcrlf with "<br>". Change "<br>" to anything you want. You could even do something like this:

Response.Write "<p>"
Response.Write Replace(objRecordSet("myBigTextField"), vbcrlf, "</p><p>")
Response.Write "</p>"

This would wrap every "paragraph" in the row value within a <p> tag. Then you could set formatting for the <p> to help space things out as you want.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old March 8th, 2004, 05:16 AM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

        Dim nSplit As Int32 'how many word you want to split
        Dim nCount As Int32 = CInt(strBig.Length / nSplit)
        For i As Int32 = 0 To nCount - 1
            strBig.Insert(nSplit * i, "<br>")
        Next
        If nSplit * nCount <> strBig.Length Then
            strBig.Insert(strBig.Length, "<br>")
        End If
        Response.Write(strBig)

 
Old March 8th, 2004, 07:06 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

That wou
ld be a
great id
ea excep
t that i
t would
have the
 tendenc
y to cho
p my wor
ds apart
.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone know a way i can pick out only numbers crmpicco Perl 2 March 15th, 2007 08:57 AM
Need to pick up a declaration from a node ramesh.kumarm XSLT 3 March 8th, 2006 12:40 AM
pick out the 11th occurance crmpicco Classic ASP Basics 4 February 11th, 2005 04:00 AM
pick text apart darkhalf Beginning PHP 7 March 12th, 2004 04:15 PM
pick file from unix vakil Biztalk 1 July 9th, 2003 04:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.