for (int i = 0; i < myArray.Length; i++) { if(myArray[i] == null) { myArray[i] = newValue; break; } }