Reply to Re: preserve line breaks in applet parameters

Your name:

Reply:


Posted by Toby Inkster on 01/28/07 10:49

www.douglassdavis.com wrote:

> when i get the String, and print it out in the console window, it
> never has the line breaks there. Is there any way I can preserve the
> line breaks so that they are represented the same way they are in the
> HTML?

Probably not -- or rather, not consistantly across different browsers. It
is the browser that parses the PARAM element, not the Java engine. The
browser will use its normal rules for parsing attribute values, which in
many browsers will treat any extent of (horizontal or vertical) whitespace
as being equivalent to a single space character.

Try something like:

<PARAM name="mytext" value='|This|is|a|test|'>

and then using a regular expression (or such) in Java to replace '|'
chracters with '\n'.

Followups set to the Java groups for someone to post some example regular
expressions. (I would, but I can't remember how/if they work in Java.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация