How to declare an array with empty strings

  • Thread starter Thread starter Silvers11
  • Start date Start date
S

Silvers11

Guest
Hello!

I have declared a 32 index String array like this.

However when I try to loop the array. It says that all indexes are NULL except for the first index as I have declared it as an empty string.

My question is how to elegantly declare a 32 index array where all elements are an empty string without looping the whole array and do it?

Thank you!


String[] itemsLIST = new String[32];
itemsLIST[0] = ""; //This index with not be NULL but all other indexes: 1-31 will be NULL
for (int i = 0; i < itemsLIST.Length; i++)
{
String[] allparams = itemsLIST.Split('|');
}

Continue reading...
 
Back
Top