- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 159字
- 2021-07-02 15:29:28
Working with the IEnumerable generic interface
Next, in between the set of curly braces beneath the line beginning with protected void Button1_Click..., the first thing that we will do is create an array of names. For this, enter the following:
IEnumerable<string> names = new string[] { "john", "job", "janet", "mary", "steve" };
Let's name it names, and then say, create a new string array. Then, to specify the initializer list, we enter a series of names in quotes, and close this with a semicolon.
Now notice that, on the left-hand side, we have IEnumerable. This is a generic interface. As you can see, the new string array in this line can be created this way because it's possible to take an array then step through it, so that each entry inside the array is a string. So, it's IEnumerable: we can list values within it, and each value to be listed is a string. To enumerate means to list.
- Apache Oozie Essentials
- Java:Data Science Made Easy
- Implementing Cisco Networking Solutions
- Podman實戰
- 老“碼”識途
- R的極客理想:工具篇
- Python數據可視化之Matplotlib與Pyecharts實戰
- FFmpeg入門詳解:音視頻原理及應用
- INSTANT OpenNMS Starter
- 深入理解Elasticsearch(原書第3版)
- Machine Learning With Go
- 計算語言學導論
- Tableau Dashboard Cookbook
- Microsoft Dynamics GP 2013 Cookbook
- HTML5 Canvas核心技術:圖形、動畫與游戲開發