Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print() ignores \n

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Print() ignores \n

    I just found out that newlines are ignored by Print(), i.e.

    Print("Line1\nLine2");

    yields

    Line1Line2

    and not

    Line1
    Line2

    Maybe that's how Print() is supposed to behave but that'd certainly be weird.

    #2
    Check out this thread
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      Thanks mrlogik for pointing this out to me!

      So Print("Line1\r\nLine2"); works.

      However, I think this behaviour should be changed as using just "\n" is the more common way.

      My problem is that I am forwarding strings from other components to the output window, so I have to manually replace every "\n" with "\r\n" before sending them to Print().

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      626 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      359 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      562 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      567 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X