- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 146字
- 2021-07-02 15:29:29
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/>";
推薦閱讀
- 演進式架構(原書第2版)
- 程序員修煉之道:程序設計入門30講
- 小程序,巧運營:微信小程序運營招式大全
- Oracle從入門到精通(第5版)
- Android系統級深入開發
- OpenCV 4計算機視覺項目實戰(原書第2版)
- RESTful Java Web Services(Second Edition)
- ASP.NET程序開發范例寶典
- 細說Python編程:從入門到科學計算
- Red Hat Enterprise Linux Troubleshooting Guide
- Python機器學習算法與應用
- IoT Projects with Bluetooth Low Energy
- 現代C:概念剖析和編程實踐
- Instant Apache Camel Messaging System
- 區塊鏈:技術與場景