Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Looping string characters in array and displaying it in a label only shows the last character

$
0
0

I must be doing something wrong but for whatever the reason is, when I loop string characters in an array and display each character in a label only shows the last letter "E".

private void LoopText()
{
    string[] s = new string[]{"A", "B", "C", "D", "E" };
    for( int i = 0; i < s.Length; i++)
    {
        this.lblOneLetter.Text = s [i];
        for (int j = 0; j < 10000000; j++) {
            //wait
        }
    }
}

Could someone please tell me why it behaves like that and how to fix it?


Viewing all articles
Browse latest Browse all 204402

Trending Articles