Re: Frontbase CLOB newline problem
Re: Frontbase CLOB newline problem
- Subject: Re: Frontbase CLOB newline problem
- From: Q <email@hidden>
- Date: Thu, 13 Nov 2008 09:04:16 +1000
On 13/11/2008, at 6:19 AM, Lachlan Deck wrote:
So this will work for windows or unix styles. To also handle the
old styles of \r only... i.e., to transform files from any
platform this should work:
String comments = aListing.additionalComments().replaceAll("(\r?
\n?){1,2}+", "\\\\n")
Hmm.. this isn't going to do what you think.
You're right. This will though
String comments = aListing.additionalComments().replaceAll("[\\r\\n]
{1,2}+", "\\\\n");
At the risk of dragging this on indefinitely. No, this won't work
either, it does not deal with the case of having two \r 's or two \n's
in a row.
or more boringly:
String comments = aListing.additionalComments().replaceAll("\r",
"").replaceAll("\n", "\\\\n");
Neither is this.
Right again :-) Serves me right for speaking so quickly :-)
String comments = aListing.additionalComments().replaceAll("\r\n",
"\n").replaceAll("\r", "\n").replaceAll("\n", "\\\\n");
That should work, albeit in not the most efficient manner.
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden