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. Linefeed in C#

Linefeed in C#

Scheduled Pinned Locked Moved C#
csharpc++
4 Posts 4 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.
  • E Offline
    E Offline
    electriac
    wrote on last edited by
    #1

    What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.

    G B M 3 Replies Last reply
    0
    • E electriac

      What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Have a look here: Environment.NewLine[^]

      #region signature my articles #endregion

      1 Reply Last reply
      0
      • E electriac

        What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.

        B Offline
        B Offline
        BoneSoft
        wrote on last edited by
        #3

        Try

        Texg.Write(" + \\");
        Texg.WriteLine("New Text String");

        or

        Texg.Write(" + \\");
        Texg.Write("\r\n");
        Texg.Write("New Text String");


        Try code model generation tools at BoneSoft.com.

        1 Reply Last reply
        0
        • E electriac

          What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.

          M Offline
          M Offline
          Michael Potter
          wrote on last edited by
          #4

          try:

          Texg.Write(@" + \");
          Texg.Write(Environment.NewLine);
          Texg.Write(@"New Text String");
          
          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