Use something like:
String NEWLINE = System.getProperty("line.separator");

The NEWLINE String is immutable and will be correct for the OS where the code is 
executed... :-)

Sincerely yours;

Mark Mynsted



VHA Management Information Systems Client Services
[EMAIL PROTECTED]
(972) 830 - 0592, Internal x1592

>>> [EMAIL PROTECTED] 5/17/2001 1:59:48 PM >>>
So what's the value of "text"?  Does it include some kind of line break
character, or doesn't it?

(You might want to try something like,

    for (int i = 0; i != text.length(); i++)
    {
      char c = text.charAt(i);
      if (Character.isSpace(c) && c != ' ')
        System.err.println("Char " + i + "=0x" +
                           Integer.toHexString(text.charAt(i));
    }

to see whether you've got one of: 0x9 (tab); 0xA (newline); 0xC (form feed);
or 0xD (carriage return).)

The problem is almost certainly that you're emitting a DOS newline (0xA 0xD)
where you really want a "standard" newline (0xA).

                                                            -- Bill K.


> -----Original Message-----
> From: Christoph Kukulies [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, May 17, 2001 10:31 AM
> To: [EMAIL PROTECTED] 
> Subject: inserted line feeds in concatenated strings
> 
> 
> 
> I'm seeing different browser behaviour between unix netscape
> vs. Windows (NT) Netscape or MSIE.
> 
> I'm generating a page with text between <PRE>...</PRE>.
> The text is generated via out.println(text + "," + number);
> and I get a line break after 'text' while under Unix browsers I don't
> get a line break.
> 
> Any idea?
> -- 
> Chris Christoph P. U. Kukulies [EMAIL PROTECTED] 
> 

Reply via email to