Unicode Control Characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Most example code I've seen uses the code "\n" to perform a CRLF, and this seems to work fine in most instances, although I've just tried to issue it over a TcpClient and it appears to just perform a LF. Is there another control char for CR

If not, what's the best way to issue a CRLF over a TcpClient, without having to use a seperate WriteLine method for each line

Thanks
Jennifer
 
Jennifer said:
Hi,

Most example code I've seen uses the code "\n" to perform a CRLF, and
this seems to work fine in most instances, although I've just tried
to issue it over a TcpClient and it appears to just perform a LF. Is
there another control char for CR?

If not, what's the best way to issue a CRLF over a TcpClient, without
having to use a seperate WriteLine method for each line.

Thanks,
Jennifer

Environment.NewLine

- pete
 
AirPete said:
Environment.NewLine

- pete

Also, I *think* '\r' is the character for a CR, but using
Environment.NewLine is much more portable, and nicer looking.

- Pete
 
AirPete said:
Also, I *think* '\r' is the character for a CR, but using
Environment.NewLine is much more portable, and nicer looking.

You shouldn't blindly use Environment.NewLine though - particularly not
over sockets, where usually the protocol is well-defined.

Environment.NewLine gives the usual new line string to use for files on
the current system. That's *not* what's usually wanted over a network
connection.

\r is always carriage return
\n is always linefeed
 
Back
Top