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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      249 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      161 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      165 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      250 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      203 views
      0 likes
      Last Post CarlTrading  
      Working...
      X