Array Qustion, fairly simple

What i want to do is write this, but in shorter:

	if(bag[0] == 0) {
		button1 = "Empty";
	}
	if(bag[1] == 0) {
		button2 = "Empty";
	}
	if(bag[2] == 0) {
		button3 = "Empty";
	}
	if(bag[3] == 0) {
		button4 = "Empty";
	}
	if(bag[4] == 0) {
		button5 = "Empty";
	}
	if(bag[5] == 0) {
		button6 = "Empty";
	}
	if(bag[6] == 0) {
		button7 = "Empty";
	}
	if(bag[7] == 0) {
		button8 = "Empty";
	}
	if(bag[8] == 0) {
		button9 = "Empty";
	}

The array of bag[ ] is set to a max of 9 spots. So what i want to do is have it cycle from 0 to 8 to see if any of them are equal to 0, if so, mark the corresponding button as empty. I do not know the syntax for this, nor how to go about doing it, though it should be fairly simple solution for someone more experienced.

buttons = new string[9];
for (i = 0; i<bag.Length; i++) {
    if (bag[i] == 0) {
        buttons[i] = "Empty";  
    }
}

Here I’m using an array: “buttons”, to replace 9 individual variables. You might have intended differently, but it seems cleaner. This approach can be slightly modified to fit the other case.

Thanks! That is what i was looking for! Also, i used the 9 separate buttons mainly since it wasn’t to hard to implement, and i was debugging along with making the buttons so i made them one step at a time.