Vinny wrote:
Sorry,
I sent this to the wrong "user" list.
Yes you did - and that's why I know a lot of Java and only a little Groovy.
(and cannot see if anybody has answered your question)
Anyway, this should be the same in Java and Groovy: String.split uses a
REGULAR EXPRESSION to split.
A period (.) is a wildcard for "any character" and therefore regards
every character as a separator with "nothing in between" :-)
You must escape the period, it should work with split("\\.")
Good luck!
On Wed, Jun 4, 2008 at 11:06 PM, Vinny <[EMAIL PROTECTED]> wrote:
OK, this one baffles me :)
"file.txt".split(".") produces an empty array ?
testing it on the groovysh, (trying to that more often before posting
on the list) :
groovy:000> mysplit = "file.txt".split(".")
===> [Ljava.lang.String;@73b4f342
groovy:000> mysplit.size()
===> 0
groovy:000> println mysplit
{}
===> null
Thanks in advance.
--
The future is here. It's just not widely distributed yet.
-William Gibson
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]