Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Replace Carriage return

Posted on 2004-08-06
8
Medium Priority
?
16,451 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 100 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
Technology Partners: 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 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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