- 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/>";
推薦閱讀
- Java逍遙游記
- Modular Programming with Python
- 編程卓越之道(卷3):軟件工程化
- Python自動化運維快速入門
- C語言程序設計
- 新編Premiere Pro CC從入門到精通
- Java設計模式及實踐
- MySQL數據庫管理與開發實踐教程 (清華電腦學堂)
- Unity 5.x By Example
- Mastering JavaScript Design Patterns(Second Edition)
- Jenkins Continuous Integration Cookbook(Second Edition)
- Python機器學習:預測分析核心算法
- Angular Design Patterns
- PostgreSQL 12 High Availability Cookbook
- Java面試一戰到底(基礎卷)