( in fact its not just between platforms - this bites even within Windows - output to file and a Gui widget for e.g.)
i.e you have to do something like
- Code: Select all
nl=Environment.newLine
...
string='\nline1...[nl]line2...[nl]....[nl]
...
rather than the more obvious
- Code: Select all
string='\nline1...\nline2...\n....\n\n
# or
string='\r\nline1...\r\nline2...\r\n....\r\n\r\n
I propose adding another c'\?' metacharacter to the currently supported set ( '\n', \r', '\t', ...) for strings
that expands to Environment.newLine automatically
I'd suggest '\N'
- Code: Select all
string='\Nline1...\Nline2...\N....\N\N
(in an attempt to belabour the point, the first block of example code above has a deliberate mistake in it)