string strs = string.Empty;
            string[] strArray1 = { "a", "b", "c", "d" };
            string[] strArray2 = { "a", "b", "c", "f", "g" };

Dictionary<string, string> map = new Dictionary<string, string>();
          
            for (int k = 0; k < strArray1.Length; k++)
            {
      map.Add(strArray1[k], "");
            }

for (int m = 0; m < strArray2.Length; m++)
            {
      //数组一已经存在的直值是否包含指定的键值,不包含的才取出来
                if (!map.ContainsKey(strArray2[m]))
                {
                    strs += strArray2[m] + ",";
                }
            }

Response.Write("strArray1字符串数组跟字符串数组strArray2比较,strArray1字符串数组中不含有strArray2数组中的有:" + strs);

C#数组比较取值的更多相关文章

  1. python数组冒号取值操作

    1.冒号的用法 1.1 一个冒号 a[i:j] 这里的i指起始位置,默认为0:j是终止位置,默认为len(a),在取出数组中的值时就会从数组下标i(包括)一直取到下标j(不包括j) 在一个冒号的情况下 ...

  2. Shell系列(38)- 数组操作→取值、遍历、替换、删除

    引言 在Linux平台上工作,我们经常需要使用shell来编写一些有用.有意义的脚本程序.有时,会经常使用shell数组.那么,shell中的数组是怎么表现的呢,又是怎么定义的呢?接下来逐一的进行讲解 ...

  3. java从c struct传来的字节数组中取值

    public int getInt(byte[] array,int index) { return (array[index]  & 0xff)  | (array[index + 1] & ...

  4. Json数组对象取值

    1.数据格式 {"data":[{"username":"xxx","avatar":"xxx",& ...

  5. php 数组随机取值

    array_rand()在你想从数组中取出一个或多个随机的单元时相当有用.它接受 input 作为输入数组和一个可选的参数 num_req,指明了你想取出多少个单元 - 如果没有指定,默认为 1. a ...

  6. 快速数组对象取值与数组映射新数组--array.map

    array.map(callback,[ thisObject]); 1.map方法的作用不难理解,“映射”嘛,也就是原数组被“映射”成对应新数组 a)array.map(()=>值); [1, ...

  7. linux shell 中的数组的取值 遍历 替换 删除操作

    引言 在Linux平台上工作,我们经常需要使用shell来编写一些有用.有意义的脚本程序.有时,会经常使用shell数组.那么,shell中的数组是怎么表现的呢,又是怎么定义的呢?接下来逐一的进行讲解 ...

  8. php二维数组的取值与转换

    while(list($key,$value) = each($arr)) { while(list($k,$v) = each($value)) { echo $key."==>&q ...

  9. Android JNI编程(四)——C语言多级指针、数组取值、从控制台输入数组

    版权声明:本文出自阿钟的博客,转载请注明出处:http://blog.csdn.net/a_zhon/. 目录(?)[+] 一:前面我们介绍了一级指针的相关概念和用发,今天我们就来说一说多级指针. 1 ...

随机推荐

  1. mime type 概要介绍

    内容类型 内容类型(Content-Type),这个头部领域用于指定消息的类型.一般以下面的形式出现. Content-Type: [type]/[subtype]; parameter type t ...

  2. 如何将std::string转int,double? (C/C++) (C) (template)

    http://www.cnblogs.com/oomusou/archive/2008/08/01/525647.html http://blog.sina.com.cn/s/blog_a843a88 ...

  3. .Net 代码安全保护产品DNGuard HVM使用

    前辈人物写的程序啊! 官方网站:http://www.dnguard.net/index.aspx 官方博客:http://www.cnblogs.com/rick/ (很久没更新了) 原文http: ...

  4. DataGridView 添加ComboBox

    http://www.wapsolo.com/Personal/personal_view_75.aspx DataGridView 添加ComboBox 第一: 先在窗体设计时拖一个ComBoBox ...

  5. UVA1395

    // UVa1395 Slim Span // Rujia Liu #include<cstdio> #include<cmath> #include<cstring&g ...

  6. PostgreSQL的 initdb 源代码分析之一

    开始第一段: int main(int argc, char *argv[]) { /* * options with no short version return a low integer, t ...

  7. [Mapreduce]eclipse下写wordcount

    上传两个文件到hdfs上的input目录下 代码例如以下: import java.io.IOException; import java.util.StringTokenizer; import o ...

  8. [AngularJS] ui-router: named views

    The ui-router library for AngularJS provides the ability to name views within your application. This ...

  9. Android 进阶学习:事件分发机制全然解析,带你从源代码的角度彻底理解(上)

    http://blog.csdn.net/guolin_blog/article/details/9097463 事实上我一直准备写一篇关于Android事件分发机制的文章,从我的第一篇博客開始,就零 ...

  10. 把json格式对象转成可提交字符串格式,会过滤掉函数 {a: {b: 3}, b: [1], c: "d"} -> a.b=3&b[0]=1&c=d

    var json = { name: "任务名称" , scoreRule: "", score: "", // 如果规则表达式不为空,则默 ...