- 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/>";
推薦閱讀
- 大話PLC(輕松動漫版)
- Visual C++程序設計學習筆記
- SQL語言從入門到精通
- 新編Premiere Pro CC從入門到精通
- Python 3破冰人工智能:從入門到實戰
- Mastering Linux Network Administration
- SQL經典實例(第2版)
- MATLAB for Machine Learning
- 零基礎學Python網絡爬蟲案例實戰全流程詳解(入門與提高篇)
- Java多線程并發體系實戰(微課視頻版)
- JavaWeb從入門到精通(視頻實戰版)
- 一步一步學Spring Boot:微服務項目實戰(第2版)
- Pandas入門與實戰應用:基于Python的數據分析與處理
- Java EE 7 First Look
- R語言編程:基于tidyverse