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 kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      34 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      29 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      36 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      33 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      143 views
      0 likes
      Last Post SalmaTrader  
      Working...
      X