Replace Carriage return

I would like to replace a Carriage Return with a space in C#
something like this:
myString.Replace(carriage return, " ")
Thanks
MichaelMullinAsked:
Who is Participating?
 
gregoryyoungConnect With a Mentor Commented:
Michael. Please you the feedback system for feedback and the question for questions on the original question. I say this because the feedback system does not alert me that you have placed a comment so it may be a long time before I see it :) In the question when you place a comment I will generally see it within a few hours.

Cheers,

Greg
0
 
ZylochConnect With a Mentor Commented:
Hi

You can use System.Text.RegularExpressions:

using System.Text.RegularExpressions;

string myString = "Hey\r\nWhat\r";
myString = r.Replace(myString, @"\r", " ");
Console.WriteLine(output);

Regards,
Zyloch
0
 
gregoryyoungCommented:
you mean ...

string myString = "Hey\r\nWhat\r";
myString = myString.Replace(myString, @"\r", " ");
Console.WriteLine(myString);
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
ZylochCommented:
Ah, oops, that's my bad, sorry.
0
 
gregoryyoungCommented:
actually ...

string myString = "Hey\r\nWhat\r";
myString = myString.Replace(@"\r", " ");
Console.WriteLine(myString);
0
 
gregoryyoungCommented:
nah, you're rright it was absolutly collaborative.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.