CRLF??
-
Hi. I got a very simple question. I'm trying to ensamble a string with some texts and CRLF on it. The question is how could I add these CRLF? I mean, ie in VB there are constants like vbCrlf and vbTab and you can write: string1 + vbCrlf + string2 + vbTab + string3.... and so on. Where could I find these kind of constants in C#? or what should I write instead? Thankx very much.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
-
Hi. I got a very simple question. I'm trying to ensamble a string with some texts and CRLF on it. The question is how could I add these CRLF? I mean, ie in VB there are constants like vbCrlf and vbTab and you can write: string1 + vbCrlf + string2 + vbTab + string3.... and so on. Where could I find these kind of constants in C#? or what should I write instead? Thankx very much.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
Hi, in C-like languages (C, C++, Java, C#) there are escapes for special characters, such as
\r
for CR,\n
for LF,\t
for TAB,\\
for BACKSLASH. So you can write things such as"line 1\r\nline2"
. If however you want to generate a platform-dependent "go to the next line" (for .NET versions on different hardware/OS combinations), then"line 1"+Environment.NewLine+"line 2"
is the right choice. If you are new to C# (or any other programming language) I would suggest you buy a book on it and work your way through it, that's the easiest way to learn the basics. :)Luc Pattyn [Forum Guidelines] [My Articles]
Sorry for any delays in replying, I currently don't get e-mail notifications.
-
Hi, in C-like languages (C, C++, Java, C#) there are escapes for special characters, such as
\r
for CR,\n
for LF,\t
for TAB,\\
for BACKSLASH. So you can write things such as"line 1\r\nline2"
. If however you want to generate a platform-dependent "go to the next line" (for .NET versions on different hardware/OS combinations), then"line 1"+Environment.NewLine+"line 2"
is the right choice. If you are new to C# (or any other programming language) I would suggest you buy a book on it and work your way through it, that's the easiest way to learn the basics. :)Luc Pattyn [Forum Guidelines] [My Articles]
Sorry for any delays in replying, I currently don't get e-mail notifications.
Oh yes :doh: , of course is like C. I did'nt tried that. I was thinking in a VB way, instead of a C way. Thank you very much.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )