Solved

Remove newline character from a string

Posted on 2008-06-09
3
1,875 Views
Last Modified: 2011-10-19
See the attached file. It contain the string that i wish to parse out. The block you see in front of Sr.Manager in the attached file, i the problem . I am not sure if it is a newline character or not since i used various replace functions and it did not work.

Replace(strRip, vbNewLine, "", , , vbTextCompare)
Replace(strRip, vbNewLine, vbNullString)
Replace("\n", ")
newline.txt
0
Comment
Question by:TECH_NET
3 Comments
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 150 total points
Comment Utility
vbNewLine is only LF.  You need to replace CR and LF.  I couldn't get it to work with vbCrLf, so I broke it up into to operations:

strRip = strRip.Replace(vbCr, "")
strRip = strRip.Replace(vbLf, "")

Also note that there are some tabs in there, you can use vbTab if you want to remove that as well.
0
 
LVL 2

Expert Comment

by:rbmyoung
Comment Utility
You could also try replacing Chr(13):
strRip = strRip.Replace(Chr(13), "")

But that may not get you exactly where you want to be as it looks like you have tabs as well.
0
 
LVL 7

Assisted Solution

by:ydramu
ydramu earned 100 total points
Comment Utility
http://www.experts-exchange.com/Programming/Languages/SQL_Syntax/Q_23406187.html

The above url is for SQL.

But for VB.NET.

strValue = strValue.Replace(vbCrLf, String.Empty)
0

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

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

18 Experts available now in Live!

Get 1:1 Help Now