Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. CRLF??

CRLF??

Scheduled Pinned Locked Moved C#
questioncsharpc++tutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Demian Panello
    wrote on last edited by
    #1

    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- )

    L 1 Reply Last reply
    0
    • D Demian Panello

      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- )

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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.


      D 1 Reply Last reply
      0
      • L Luc Pattyn

        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.


        D Offline
        D Offline
        Demian Panello
        wrote on last edited by
        #3

        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- )

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups