inaccurate values in listitem
<p>I have the following code that should generate listitems from a string that came from server. The code is as follows: </p>

<pre><code>foreach (String str in years)
            {

                if (string.IsNullOrEmpty(str) || str.Equals(" "))
                {
                    System.Diagnostics.Debug.WriteLine("empty");
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine(str);
                    yearLi.Value = str;
                    yearList.Add(yearLi);
                    count = yearList.Count;
                }
                System.Diagnostics.Debug.WriteLine("count--&gt;" + count);

            }
</code></pre>

<p>Now my problem is,if the string array "years" has {2011,2012} the list should be 2011 and 2012. But it has 2012,2012. I am not able to find the fault in this code. Please advice.</p>
