Solved

Replace Carriage return

Posted on 2004-08-06
8
16,442 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now