OfType的用法
来源:互联网 发布:linux物理内存分配 编辑:程序博客网 时间:2024/06/05 03:53
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { List<object> fruits = new List<object>(4); fruits.Add("Mango"); fruits.Add("Orange"); fruits.Add("Apple"); fruits.Add(3.0); fruits.Add("Banana"); // Apply OfType() to the ArrayList. IEnumerable<string> query1 = fruits.OfType<string>(); string outputBlock = ""; outputBlock += "Elements of type 'string' are:" + "\n"; foreach (string fruit in query1) { outputBlock += fruit + "\n"; } // The following query shows that the standard query operators such as // Where() can be applied to the ArrayList type after calling OfType(). IEnumerable<string> query2 = fruits.OfType<string>().Where(fruit => fruit.ToLower().Contains("n")); outputBlock+= "\nThe following strings contain 'n':" + "\n"; foreach (string fruit in query2) { outputBlock += fruit + "\n"; } Console.WriteLine(outputBlock); Console.ReadKey(); } }}
0 0
- OfType的用法
- mybatis的javaType和ofType
- 窗体Controls的OfType<>方法的使用
- [[NSBundle mainBundle]pathForResource:@"XXX" ofType:@"db"]为nil的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- iOS开发中 [[NSBundle mainBundle] pathForResource: ofType:]路径为空的问题
- OFType枚举类
- AsEnumerable , OfType , Cast 区别
- jdbcType、javaType 、ofType
- RxJava 过滤操作符 ofType
- Enumerable.OfType<TResult> 方法 (IEnumerable)
- MyBatis ofType和javaType区别
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- WebService之初体验
- 修改sql数据库默认端口(原1433端口)
- 改变态度,就能改变你的高度
- C语言中的一些关键字(十四)
- ATOM编辑器
- OfType的用法
- System V 消息队列
- BZOJ 2648 (kdtree)
- ios APNS 消息一直接收不到解决办法
- DLL内存加载
- nginx源码安装configure命令的参数介绍
- stm32f103zet6使用adc3通过dma2_5转换
- shell排序命令-sort
- ubuntu16.04下安装opencv2,以及opencv3与cuda8不兼容