473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

String and linefeed

Dear friends

How do I by code identify linefeed in a string and delete it?

Regards Able
Nov 20 '05 #1
8 1280
Hi!
Try the following:
MyString=MyString.Replace(ControlChars.Lf,"")
Hope this helps,
Andy

"Able" <ab**@epost.no> schrieb im Newsbeitrag
news:fv******************@news2.e.nsc.no...
Dear friends

How do I by code identify linefeed in a string and delete it?

Regards Able

Nov 20 '05 #2
Hi Able

Try

stringContainingLinefeed.Replace(Convert.ToChar(&H A), String.Empty)

HTH

Charles
"Able" <ab**@epost.no> wrote in message
news:fv******************@news2.e.nsc.no...
Dear friends

How do I by code identify linefeed in a string and delete it?

Regards Able

Nov 20 '05 #3
Hi,

Dim strOut As String = "This " & vbLf & "should be one " & vbLf & "line."

strOut = strOut.Replace(vbLf, "")

Ken
--------------
"Able" <ab**@epost.no> wrote in message
news:fv******************@news2.e.nsc.no...
Dear friends

How do I by code identify linefeed in a string and delete it?

Regards Able

Nov 20 '05 #4
"Able" <ab**@epost.no> schrieb

How do I by code identify linefeed in a string and delete it?


s = s.replace(chr(10), "")
If you want to delete carriage return+line feed, use

s = s.replace(vbcrlf, "")
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
Cor
Hi Able,

Maybe you get a lot of others,
(Not that you should take this, but I saw already 3 other methods)
aString = Replace(myString, chr(10), "")

:-)

Cor
Nov 20 '05 #6
* "Able" <ab**@epost.no> scripsit:
How do I by code identify linefeed in a string and delete it?


\\\
Dim s As String = ...
s = s.Replace(ControlChars.Lf, "")
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
Cor
Hi Herfried,

Was already given by Andreas, I thought you could better,

:-))

Cor
Herfried
\\\
Dim s As String = ...
s = s.Replace(ControlChars.Lf, "")
///

\\\Andreas
Try the following:
MyString=MyString.Replace(ControlChars.Lf,"")
Hope this helps,
///
Nov 20 '05 #8
* "Cor" <no*@non.com> scripsit:
Was already given by Andreas, I thought you could better,


:->

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Johannes Busse | last post by:
Hello, I use saxon 6.5.3. under SuSE 9.1. In my stylesheet I give out messages like <xsl:message> <xsl:value-of select="$myId" /> <xsl:text> | </xsl:text> </xsl:message>
7
by: Tariq | last post by:
Hi, I am trying to do this bit using client side script in an asp page var x = "<%ServerVar%>"; The issue is if SerVar has carraige returns the Unterminates String Constant error is thrown...
2
by: MLH | last post by:
I use A97. I want to remove carriage return / linefeed pairs from a memo field. How can I strip a string of these special, non-printing characters?
1
by: Hai Ly Hoang | last post by:
Hi, I have string which contains linefeed and carry-return characters (eg. "Banana \r\n Apple \r\n..."); To print this string, i make use of PrintPage event of PrintDocument with DrawString...
2
by: cloudx | last post by:
Hi there, Here is the line of VB code and I would like to translate into C#, please help! Thanks! sMsgIntHeader = (Replace(Replace(Trim(Left(sErrorMsg, InStr(5, sErrorMsg, vbCrLf))), vbLf,...
3
by: Paul | last post by:
Hi, My RichTextBox has multiple lines of text. Most of the lines unfortunately end with a space. Is it possible to replace the space and NewLine/Line Feed with just the NewLine/LineFeed? So...
4
by: John K Masters | last post by:
>From what I have read the string module is obsolete and should not be used but I am working on a project that parses printable files created in a DOS program and creates a web page for each file....
23
by: KIRAN | last post by:
Hi all, can i split a C string like this? char * p = "Hello \ World\n\r"; is this according to standard? Any help or link to standard regarding the above doubt is aprreciated... Regards, Kiran
3
by: James Kanze | last post by:
On Sep 12, 7:25 am, Ruben <ru...@www2.mrbrklyn.comwrote: You can specify a delimitor when calling getline, but I'd tend to consider that a bit abuse. I'd just parse the string directly,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.