Solved

Remove newline character from a string

Posted on 2008-06-09
3
1,877 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
ID: 21745499
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
ID: 21745566
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
ID: 21745665
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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