DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    37

    Strip vbNewLine.

    Hey Folks,

    I am new to VB.net and I want to be able to strip out new lines from the end of paragraphs... ie:

    =======================
    Here is a line of text.

    I want to keep the line break above this one.

    I do not want to keep the three blank lines below this line...



    =======================

    I know that I could just strip out the lines, but I want to keep the ones that actually make sense and delete the extras at the bottom...

    Thanks.

    vs

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Dim TrimChars() As Char = {Chr(13), Chr(10)}
    theText = theText.TrimEnd(TrimChars)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Sep 2004
    Posts
    37
    That didn't work for some reason?

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Worked for me. Can you post the code you used to test it?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links