码迷,mamicode.com
首页 > Windows程序 > 详细

C# Array.FindAll

时间:2015-11-06 12:39:18      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

技术分享技术分享
 1  string[] arrySource = { "C#111", "C#22222", "C222", "safdaf", "Cwedad" };
 2  string[] tempResult;
 3  private void Form1_Load(object sender, EventArgs e)
 4  {
 5             
 6     DisplayView(arrySource, txtSource);
 7  }
 8  public void DisplayView(string [] sourece,TextBox txtView)
 9   {
10     txtView.Enabled = false;
11     for (int i = 0; i < sourece.Length; i++)
12        {
13          txtView.Text += sourece[i] + "\r\n";
14        }
15   }
16
17  private void txtSerach_TextChanged(object sender, EventArgs e)
18  {
19    tempResult=Array.FindAll<string>(arrySource, (s) => s.Contains(txtSerach.Text));
20    //tempResult= Array.FindAll(arrySource, (s) => s.Contains(txtSerach.Text));
21     txtResult.Clear();
22     DisplayView(tempResult, txtResult);
23  }

 

 

C# Array.FindAll

标签:

原文地址:http://www.cnblogs.com/niceskyfly/p/4941943.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!