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. Right So i have this string full of text and '\n' and i write it to a file

Right So i have this string full of text and '\n' and i write it to a file

Scheduled Pinned Locked Moved C#
question
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.
  • A Offline
    A Offline
    Anthony Mushrow
    wrote on last edited by
    #1

    And when i write the string to a file, it doesnt get the newline bit right, you just get a bar. So how do i get it to do a new line. (I would REALLY like to do this without having to do WriteLine every time i need a new line).

    A L C 3 Replies Last reply
    0
    • A Anthony Mushrow

      And when i write the string to a file, it doesnt get the newline bit right, you just get a bar. So how do i get it to do a new line. (I would REALLY like to do this without having to do WriteLine every time i need a new line).

      A Offline
      A Offline
      afinnell
      wrote on last edited by
      #2

      Shouldn't you use \r\n instead? - Drew

      1 Reply Last reply
      0
      • A Anthony Mushrow

        And when i write the string to a file, it doesnt get the newline bit right, you just get a bar. So how do i get it to do a new line. (I would REALLY like to do this without having to do WriteLine every time i need a new line).

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        You are probably viewing the output in notepad that doesnt support different line endings. Try wordpad of VS instead. xacc.ide-0.1-rc4 released! Download and screenshots

        1 Reply Last reply
        0
        • A Anthony Mushrow

          And when i write the string to a file, it doesnt get the newline bit right, you just get a bar. So how do i get it to do a new line. (I would REALLY like to do this without having to do WriteLine every time i need a new line).

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          The correct way to do this is use Environment.NewLine as it will generate the correct newline sequence for the current platform.


          My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious

          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