How to handle "\r\n"?

I would like to remove '\r\n" from my string value. (I tried Generic and String Types)
I have tried

  1. .Replace(“\r\n”)
  2. .Split({“\r\n”},System.StringSplitOptions.None)

Any other special means? Can someone please help throw some light?
Help appreciated.

1 Like

Have you tried split using Environment.NewLine ?

Hi, you can try this,

yourString.Replace(Environment.NewLine, String.Empty)

1 Like

Let me try this and get back. Appreciate your help.

for option 1, if you use replace I think you would need to set what you are replacing \r\n with, so in this case:

.Replace(“\r\n”,“”)

Yes I did that and it did not help.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.