- 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/>";
推薦閱讀
- Bootstrap Site Blueprints Volume II
- Mastering JavaScript Object-Oriented Programming
- Flink SQL與DataStream入門、進(jìn)階與實(shí)戰(zhàn)
- JavaScript動(dòng)態(tài)網(wǎng)頁開發(fā)詳解
- 實(shí)戰(zhàn)Java高并發(fā)程序設(shè)計(jì)(第3版)
- Building an RPG with Unity 2018
- R大數(shù)據(jù)分析實(shí)用指南
- Python編程從0到1(視頻教學(xué)版)
- JavaScript腳本特效編程給力起飛
- Hands-On Kubernetes on Windows
- HTML+CSS+JavaScript編程入門指南(全2冊(cè))
- 深入實(shí)踐DDD:以DSL驅(qū)動(dòng)復(fù)雜軟件開發(fā)
- Julia High Performance(Second Edition)
- Clojure Polymorphism
- Java高并發(fā)編程詳解:深入理解并發(fā)核心庫