using System;
using System.Collections.Generic;
using System.Linq; namespace Linq101
{
class Miscellaneous
{
/// <summary>
/// This sample uses Concat to create one sequence that contains each array's values, one after the other.
/// </summary>
public void Linq94()
{
int[] numbersA = { , , , , , , };
int[] numbersB = { , , , , }; var allNumbers = numbersA.Concat(numbersB); Console.WriteLine("All numbers from both arrays:"); foreach (int number in allNumbers)
{
Console.WriteLine(number);
}
} /// <summary>
/// This sample uses Concat to create one sequence that contains the names of all customers and products, including any duplicates.
/// </summary>
public void Linq95()
{
List<Data.Customer> customers = Data.GetCustomerList();
List<Data.Product> products = Data.GetProductList(); var customerNames = from c in customers
select c.CompanyName;
var productNames = from p in products
select p.ProductName; var allNames = customerNames.Concat(productNames); Console.WriteLine("Customer and product names:"); foreach (string name in allNames)
{
Console.WriteLine(name);
}
} /// <summary>
/// This sample uses EqualAll to see if two sequences match on all elements in the same order.
/// </summary>
public void Linq96()
{
var wordsA = new[] { "cherry", "apple", "blueberry" };
var wordsB = new[] { "cherry", "apple", "blueberry" }; bool match = wordsA.SequenceEqual(wordsB); Console.WriteLine("The sequences match :{0}", match);
} /// <summary>
/// This sample uses EqualAll to see if two sequences match on all elements in the same order.
/// </summary>
public void Linq97()
{
var wordsA = new[] { "cherry", "apple", "blueberry" };
var wordsB = new[] { "apple", "blueberry", "cherry" }; bool match = wordsA.SequenceEqual(wordsB); Console.WriteLine("The sequences match: {0}", match);
}
}
}

Linq101-Miscellaneous的更多相关文章

  1. 小白日记46:kali渗透测试之Web渗透-SqlMap自动注入(四)-sqlmap参数详解- Enumeration,Brute force,UDF injection,File system,OS,Windows Registry,General,Miscellaneous

    sqlmap自动注入 Enumeration[数据枚举] --privileges -U username[CU 当前账号] -D dvwa -T users -C user --columns  [ ...

  2. Chapter 13. Miscellaneous PerlTk Methods PerlTk 方法杂项:

    Chapter 13. Miscellaneous PerlTk Methods PerlTk 方法杂项: 到目前为止,这本书的大部分章节 集中在特定的几个部件, 这个章节覆盖了方法和子程序 可以被任 ...

  3. Miscellaneous Articles

    标记一下,慢慢看  http://www.oracle-base.com/articles/misc/articles-misc.php Miscellaneous Articles DBA Deve ...

  4. Sass函数-Miscellaneous函数(三元条件函数)

    在这里把 Miscellaneous 函数称为三元条件函数,主要因为他和 JavaScript 中的三元判断非常的相似.他有两个值,当条件成立返回一种值,当条件不成立时返回另一种值: if($cond ...

  5. Quartz Tutorial 11 - Miscellaneous Features of Quartz

    文章目录 Plug-Ins Quartz提供了一个接口(org.quartz.spi.SchedulerPlugin) 用于插入附加的功能. 与Quartz一同发布的,提供了各种实用功能的插件可以在o ...

  6. MinkowskiEngine Miscellaneous Classes杂类

    Miscellaneous Classes杂类 内核生成器 class MinkowskiEngine.KernelGenerator(kernel_size = -1,stride = 1,dila ...

  7. Confluence 6 数据库表-杂项(Miscellaneous)

    这些部分是一些其他的表格,这些表格有必要在这里提及下能帮你更好的了解系统. os_propertyentry 有关实体和属性相关的特性. bandana 所有的持久层.这个表格包含的的内容有用户设置和 ...

  8. Loadrunder脚本篇——Run-time Settings之Miscellaneous

    作用说明 提供混杂设置,如错误处理,多线程,自动化事务设置等 注意:仅对指定协议有效   Error Handling Continue on Error 开启后,在VuGen中,如脚本中某个函数出错 ...

  9. uvm_misc——杂货铺(miscellaneous)

    uvm_misc 是个很有意思的文件夹,本质上就是个UVM的杂货铺,包含一些很重要的class, task, function, 但不知道给归类到哪儿,所以,uvm_misc就很好地承担了这个任务,几 ...

  10. 【miscellaneous】【C/C++语言】UTF8与GBK字符编码之间的相互转换

    UTF8与GBK字符编码之间的相互转换 C++ UTF8编码转换 CChineseCode 一 预备知识 1,字符:字符是抽象的最小文本单位.它没有固定的形状(可能是一个字形),而且没有值." ...

随机推荐

  1. bzoj2215: [Poi2011]Conspiracy

    Description Byteotia的领土被占领了,国王Byteasar正在打算组织秘密抵抗运动.国王需要选一些人来进行这场运动,而这些人被分为两部分:一部分成为同谋者活动在被占领区域,另一部分是 ...

  2. BZOJ 1067 降雨量

    Description 我们常常会说这样的话:"\(X\)年是自\(Y\)年以来降雨量最多的".它的含义是\(X\)年的降雨量不超过\(Y\)年,且对于任意\(Y<Z< ...

  3. Inna and Sequence

    Codeforces Round #220 (Div. 2) D:http://codeforces.com/contest/374/problem/D 题意:给你m个数,这m个数是递增的.然后给你n ...

  4. AOP举例子

    切面类TestAspect package com.spring.aop; /** * 切面 * */ public class TestAspect { public void doAfter(Jo ...

  5. POJ1416 Shredding Company(dfs)

    题目链接. 分析: 这题从早上调到现在.也不算太麻烦,细节吧. 每个数字都只有两种状态,加入前一序列和不加入前一序列.DFS枚举. #include <iostream> #include ...

  6. java程序:set改造成map

    逻辑:       set是无序不重复数据元素的集合.       map是另一种set,如果将<key,value>看成一个整体的话,其实就是set.在map中,若用map的keyset ...

  7. 数学(矩阵乘法):HDU 4565 So Easy!

    So Easy! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  8. 数学:UVAoj 11174 Stand in a Line

    Problem J Stand in a Line Input: Standard Input Output: Standard Output All the people in the bytela ...

  9. HDOJ(HDU) 2109 Fighting for HDU(简单排序比较)

    Problem Description 在上一回,我们让你猜测海东集团用地的形状,你猜对了吗?不管结果如何,都没关系,下面我继续向大家讲解海东集团的发展情况: 在最初的两年里,HDU发展非常迅速,综合 ...

  10. HDOJ 2015 偶数求和

    Problem Description 有一个长度为n(n<=100)的数列,该数列定义为从2开始的递增有序偶数,现在要求你按照顺序每m个数求出一个平均值,如果最后不足m个,则以实际数量求平均值 ...