Solved

Remove newline character from a string

Posted on 2008-06-09
3
1,881 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

636 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