Using a String to reference a label I need to set text of?
<p>So right now I have a loop to assign names to players depending on the amount selected and need to somehow construct a string to reference the labels which look some like "lblplayer1" - "lblplayer6" my code looks like this:</p>

<pre><code>for (int i=1; i &lt;= noofplayers; i++)
{
    String hello = "lblplayer" + i;
    hello?.setText("hi");
}
</code></pre>

<p>The last line needs to some equate to the variable name of lblplayer (1-6) without hard coding in the last number.
Basically I need to somehow automatically be able to set the text of each the labels somehow using the array index but not sure how to do this in any way?</p>
