By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Replacing Carriage Returns in VB.NET

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.