Skip to main content



      Home
Home » Archived » BIRT » split(".") does not work(BIRT Report Designer with BIRT v2.5.2 - split(".") does not work)
split(".") does not work [message #724275] Sun, 11 September 2011 17:46 Go to next message
Eclipse UserFriend
Hi,
I'm using BIRT Report Designer with BIRT v2.5.2 .
In my report, I tried with
var sArr = paragraph.split(".");
in order to split a paragraph (e.g "Hi, there. I am working now. Please come later.") into sentences. The returned result was sArr.length = 0 - the paragraph was not splitted. Sad
However when I tried again with comma as delimiter
var sArr = paragraph.split(",") ;
It works:
sArr[0] = Hi
sArr[1] = there. I am working now. Please come later.
It seems to be weird. Is that any exception on the colon delimiter which I missed or is that a problem with code or the development environmen?
Thanks much in advance.
Lien
Re: split(".") does not work [message #724284 is a reply to message #724275] Sun, 11 September 2011 19:23 Go to previous messageGo to next message
Eclipse UserFriend
Lien,

Just a guess, but if the argument is a regular expression then "." has
special meaning (match any character) whereas "," just means comma. So
try using "\\." (an escaped dot, and of course the backslash itself
needs to be escaped, at least in Java so probably in whatever language
this is).

On 11/09/2011 2:46 PM, LBck wrote:
> Hi,
> I'm using BIRT Report Designer with BIRT v2.5.2 . In my report, I
> tried with
> var sArr = paragraph.split(".");
> in order to split a paragraph (e.g "Hi, there. I am working now.
> Please come later.") into sentences. The returned result was
> sArr.length = 0 - the paragraph was not splitted. :( However when I
> tried again with comma as delimiter
> var sArr = paragraph.split(",") ;
> It works:
> sArr[0] = Hi
> sArr[1] = there. I am working now. Please come later.
> It seems to be weird. Is that any exception on the colon delimiter
> which I missed or is that a problem with code or the development
> environmen?
> Thanks much in advance.
> Lien
>
Re: split(".") does not work [message #724494 is a reply to message #724284] Mon, 12 September 2011 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

Thanks. I tried with "//." but pity that it has not resolved the problem:-(

by the way. I am using javascript.

[Updated on: Mon, 12 September 2011 10:23] by Moderator

Re: split(".") does not work [message #724554 is a reply to message #724494] Mon, 12 September 2011 09:54 Go to previous message
Eclipse UserFriend
I just tried this with 2.5.2 and it worked for me. I created a blank
report and added a data item with a type of string and the following
expression.

var par = "Hi, there. I am working now. Please come later."
var sArr = par.split(".") ;
sArr[1];

Jason

On 9/12/2011 9:23 AM, LBck wrote:
> Hi Ed,
>
> Thanks. I tried with "//." but pity that it has not resolved the problem:-(
>
>
Previous Topic:Dynamically change line chart or bar chart with on-screen slider
Next Topic:OSGI nor found BIRT3.7 JBOSS
Goto Forum:
  


Current Time: Wed Jul 23 17:14:45 EDT 2025

Powered by FUDForum. Page generated in 0.24625 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top