Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12393116
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C#/.net

2016-01-11 18:31:00

static void Main(string[] args)
{
    List dataList = new List();
    for (int i=0;i<5;i++)
    {
        dataList.Add("string" + i);
    }

    string result = dataList.Find(destStr => destStr == "string10");
    int index = dataList.FindIndex(0, dataList.Count, destStr => destStr == "string10");
    int index2 = dataList.FindIndex(0, dataList.Count, destStr => destStr == "string3");
    if(index2 != -1)
        dataList.RemoveAt(index2);

    Console.ReadLine();
}


参考:

http://www.cnblogs.com/zhangchenliang/archive/2012/08/15/2640396.html

阅读(2429) | 评论(0) | 转发(0) |
0

上一篇:Access中使用sql查询

下一篇:WPF datagrid应用

给主人留下些什么吧!~~