C
C
Coops2018-02-01 13:29:18
C++ / C#
Coops, 2018-02-01 13:29:18

How to remove newline in C# line?

Hello.
The response comes from the server as a string.
For example: 100
11.
I don't know the length before the line break, it all depends on the server's response.
I need to remove the hyphen or replace it with another character.
I tried like this, but it doesn't work:
str = str.Replace(Environment.NewLine, " ");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John_Nash, 2018-02-01
@Coops

A string containing "\r\n" for non-Unix platforms,...
Try searching for "\n"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question