In the current code base that I'm working on I find myself needing to initialise many empty String[] of different lengths.
As of now, they are always initialised in the following way:
String[] a = new String[]{"","","","","","","","",""} // etc...
Although this is a simple one line solution, my personal preference is that it's rather ugly.
I was just wondering if anyone is aware of any existing API/Utility that offers a method where an array of empty strings can be initialised more elegantly. I was thinking something along the lines of:
StringUtils.*initialiseEmptyArray*(int size);
Does anyone know of any such method?
I can always write my own if need be, just didn't want to re-invent the wheel if its already been done.
Thanks