Behaviour of String.split() [message #572330] |
Wed, 05 August 2009 13:15 |
Eclipse User |
|
|
|
Originally posted by: c.k.holmes.lboro.ac.uk
Behaviour of the operation split on the class String is curious. The
following output is generated from a simple model transformation:
This input (within my ETL file):
'1234.5678'.println();
'1234.5678'.split('.').println();
'1234-5678'.println();
'1234-5678'.split('-').println();
Provides this output (in the console window):
main:
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl] Running
ETL file
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl] 1234.5678
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl] Sequence {}
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl] 1234-5678
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl] Sequence
{1234, 5678}
[epsilon.etl - IndeFile2NetworkInitialisationDataCatalogue.etl]
Completed ETL file
BUILD SUCCESSFUL
There appears to be something odd with the behaviour of the split()
operation when the string delimiter is the point character '.', should I
be calling this operation differently?
Best Wishes
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.02997 seconds