473,320 Members | 1,883 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,320 software developers and data experts.

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 5111
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
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
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
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
by: John | last post by:
Hi How can I replace characters like carriage return and double quotes from strings? Thanks Regards
6
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.