473,508 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing Carriage Returns in VB.NET

How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas
Nov 17 '05 #1
5 5115
off the top of my head:

dim myNewString as string = myOldString.Replace(ControlChars.Cr, "<br />")

"Mario Vargas" <ma*********@thecourier.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas

Nov 17 '05 #2
off the top of my head:

dim myNewString as string = myOldString.Replace(ControlChars.Cr, "<br />")

"Mario Vargas" <ma*********@thecourier.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas

Nov 17 '05 #3
Thanks!

I'm used ControlChars.NewLine instead.

Mario

"Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
off the top of my head:

dim myNewString as string = myOldString.Replace(ControlChars.Cr, "<br />")

"Mario Vargas" <ma*********@thecourier.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas


Nov 17 '05 #4
Thanks!

I'm used ControlChars.NewLine instead.

Mario

"Elliot M. Rodriguez" <elliotmrodriguezatnospamhotmail.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
off the top of my head:

dim myNewString as string = myOldString.Replace(ControlChars.Cr, "<br />")

"Mario Vargas" <ma*********@thecourier.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas


Nov 17 '05 #5
you can use this:

myNewString = Replace(TextToSearch, CharacterToReplace,
ReplaceWithCharacter)

"Mario Vargas" <ma*********@thecourier.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
How do I replace carriage returns with <br /> in Visual Basic .NET?

I know this is easy to do with C# by simply calling myNewString =
myString.Replace( "\n", "<br />" );

Thank you for your input!

Mario Vargas

Nov 17 '05 #6

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

Similar topics

1
13020
by: yawnmoth | last post by:
so... i'm trying to remove all carriage returns in the input i get from GET, and am trying to replace them with three dots... however, this never seems to work... i'm still getting carriage...
7
1716
by: Rob Meade | last post by:
Hi all, Been a long time since I've been here... /me waves to all.. Ok - my conundrum.. I have a form where a user can enter text and BB codes...for example:
4
7308
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
4
2491
by: John | last post by:
Hi How can I replace characters like carriage return and double quotes from strings? Thanks Regards
6
2028
by: Tbone | last post by:
I'm changing our order confimation from a plain text to HTML. The original setup of this had carriage returns between line items. These are not interpreted by HTML so all the line items run...
0
347
by: Mario Vargas | last post by:
How do I replace carriage returns with <br /> in Visual Basic .NET? I know this is easy to do with C# by simply calling myNewString = myString.Replace( "\n", "<br />" ); Thank you for your...
2
2320
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
7
11164
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
1
3518
by: asturt | last post by:
I have a string with multiple carriage returns in it. I need to remove the second carriage return but leave all the rest. Anyone know of a function that will do this? I've come up with this: ...
0
7231
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
7133
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...
1
7066
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
5643
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
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.