Solved

Replace Carriage return

Posted on 2004-08-06
8
16,446 Views
Last Modified: 2011-08-18
I would like to replace a Carriage Return with a space in C#
something like this:
myString.Replace(carriage return, " ")
Thanks
0
Comment
Question by:MichaelMullin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 25 total points
ID: 11740872
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
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11741058
you mean ...

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

Expert Comment

by:Zyloch
ID: 11741062
Ah, oops, that's my bad, sorry.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11744576
actually ...

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

Accepted Solution

by:
gregoryyoung earned 25 total points
ID: 11744587
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
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11758854
nah, you're rright it was absolutly collaborative.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question