I have five Labels in my form.
The names of the label are the following.
1) labelTeam1Name.Text
1) labelTeam2Name.Text
3) labelTeam3Name.Text
4) labelTeam4Name.Text
5) labelTeam5Name.Text
now I want to run a loop and get the text values of the label
for( int i = 1; i < 6; i++ )
{
string str = labelTeam(i)Name.Text // Get the values based on the input i
}
I can definitely fill these values in an array or list and then call them in the loop.
is it possible to do something like this labelTeam(i)Name.Text?