Solved

Remove newline character from a string

Posted on 2008-06-09
3
1,880 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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