stringbuilder : can i determine last line, go to the last line, and delete the last line if it is blank?

Posted on 2004-11-29
Last Modified: 2006-11-17
hi, im doing a really horrible report here, and it uses a stringbuilder which appends lines constantly.
but im having problems because a last line is generated , which results in a new page which is then blank.
e.g. an actual 5 page report then goes to 6 pages, the 6th page being blank.
could i move to the last line in a stringbuilder, and then delete it?
i know of sb.remove(startindex,length) , but i cant move to the specified line
google searches have not been helpful)
Question by:jxharding
    LVL 25

    Accepted Solution

    Hi jxharding, do you know what is in that last line,

    because maybe you can just do


    Author Comment

    brilliant, thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now