Stuart Rogers wrote:and the answer came to me as soon as I posted, of course, to use String'. isEmpty()
That's one possibility, but I wonder if you're not overthinking this.
First off: You haven't explained
why you need to know this, nor indeed whether there is any logical difference between an
empty String and one that contains
some whitespace. Your "solution" would suggest not.
And if that's the case: why not just:
or indeed, just do your original split with:
String str_arry = innline.split( "\\s*\\|\\s*", 17);
(not sure why the '17', but I assume you have your reasons)
It may not be what you want, but TBH, it's difficult to know exactly what you
do want right now.
Winston
PS:
1. Using underscores in names is not generally a good idea. To a
Java programmer it looks 'C-ish'.
2. Not quite sure why you have duplicated letters in your names ('
ii', '
innline', '
lisst'). It looks
really weird.
3. I've removed the code block from your 'records' and used the 'tt' (true-type) block instead. Have a look at the
DontWriteLongLines page to find out why.