
上QQ阅读APP看书,第一时间看更新
Converting the values back to a list
After valuesMoreThanTen, you would like to be able to use a foreach loop. To do this, you've got to convert this back to a list because, remember, IEnumerable is not a list. That's why the foreach loop doesn't show if you typed it right after the . (dot) after valuesMoreThanTen. You convert it to a list, and then foreach shows. Now you can again display the values; so in foreach x, you'll take the x value and display it in a label as shown in the preceding line of code. This line now will display each x value from the valuesMoreThanTen list.
Now, you can tell just by examining it that 12, 25, and 54 should print. That's the first thing. Now, let's also display a horizontal line below this line. So, enter the following next:
sampLabel.Text += "<br><hr/>";