首页 > Windows开发 > 详细

C# Array.FindAll

时间:2015-11-06 12:37:38      阅读:1421      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!