using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private List<string> str = new List<string>();
private void button1_Click(object sender, EventArgs e)
{
string[] t1 = { "Abel", "Abner") };
str.Add('Abe");;
str.Add("Abel");
str.Add("Abner");
str.Add("Abraham");
var query = from s in str where t1.Contains(s) select s;
foreach (string s in query)
{
MessageBox.Show(s);
}
}
}
}
有興趣的朋友可以試試看喔!!
沒有留言:
張貼留言