Re: <SOLVED>Frontbase CLOB newline problem
Re: <SOLVED>Frontbase CLOB newline problem
- Subject: Re: <SOLVED>Frontbase CLOB newline problem
- From: Awbrey Hughlett <email@hidden>
- Date: Wed, 12 Nov 2008 02:40:42 -0600
Thank you all very much for the pointers.
Awbrey
On Nov 12, 2008, at 1:52 AM, Lachlan Deck wrote:
@see java.util.regex.Pattern
On 12/11/2008, at 5:37 PM, Awbrey Hughlett wrote:
On Nov 12, 2008, at 12:33 AM, Q wrote:
String comments = aListing.additionalComments().replaceAll("\r?
\n", "\\\\n")
That worked perfectly. Why is the question mark there?
@see java.util.regex.Pattern
It means \r is optional.
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")
or more boringly:
String comments = aListing.additionalComments().replaceAll("\r",
"").replaceAll("\n", "\\\\n");
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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