This question already has an answer here:
Here is my code:
serialNumbers = "";
String[] serialArray = serialNumbers.split(",");
int arrayLength = serialArray.length;
arrayLength is showing 1 even there have no value in serialArray. I was expecting that length should return 0 in this case.
,
. How many results would you expect it to return, then? When you answer that, I think you'll understand why this returns 1. – Colin Morelli Jul 15 '13 at 13:38