How to remove CR LF from a multiline text box

L

le_mo_mo

Hi,

How do you remove the CRLF from a multiline textbox entry? Does anybody
have an example?

Thanks,
MO
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

IMO a better solution is using Environment.NewLine instead of hardcoding
"\r\n"

cheers,
 
J

Jon Skeet [C# MVP]

<"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT
dot.state.fl.us> said:
IMO a better solution is using Environment.NewLine instead of hardcoding
"\r\n"

That partly depends on what other platforms use for the line separator
within textboxes. There's nothing to say it's the same as the natural
line separator for the platform. For instance, I don't know what Mono
uses as the line separator in its WinForms implementation - how sure
are you that it's "\n" instead of "\r\n"?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You are right, even in a web environment the client may has a different
separator than the server.



cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top