Given a
String that looks like this:
String temp = "\t\tAB\t\t";
I expect that when I do this:
String[] cols = temp.split("\t");
I would get a String array of size 5, each element in the array looking like this:
cols[0] == ""
cols[1] == ""
cols[2] == "AB"
cols[3] == ""
cols[4] == ""
But I don't! Instead I get this:
cols[0] == ""
cols[1] == ""
cols[2] == "AB"
What happened to the splits on tabs that occurred after the character sequence AB?
When I split I want the empty Strings before and after EVERY tab in the original String. I don't want to capture any more than this. When I try using boundary matchers in my regex I capture too much.
It seems so easy. I simply want to split on each and every tab. That's it! Any advice would be MUCH appreciated!
Thanks a bunch in advance,
Patrick Garner
[ January 11, 2004: Message edited by: Patrick Garner ]