private void distinctBtn_Click(object sender, EventArgs e) { string data = this.distinctTxt.Text; if (string.IsNullOrEmpty(data)) { MessageBox.Show("请输入数据!", "提示"); return; } List <string> list = changeList(data); //去除空白数据 list = list.Where(x => !string.IsNullOrEmpty(x)).ToList(); List <string> dataList = Helper.Distinct(list); resultFrm frm = new resultFrm(); frm.list = dataList; frm.msg = ",去除重复数据" + (list.Count - dataList.Count) + "条。"; frm.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { string data1 = this.dataTxt1.Text; string data2 = this.dataTxt2.Text; if (string.IsNullOrEmpty(data1) || string.IsNullOrEmpty(data2)) { MessageBox.Show("请输入数据!", "提示"); return; } List <string> list1 = changeList(data1); List <string> list2 = changeList(data2); //去除空白数据 list1 = list1.Where(x => !string.IsNullOrEmpty(x)).ToList(); list2 = list2.Where(x => !string.IsNullOrEmpty(x)).ToList(); List <string> listData = new List <string>(); if (this.radRepeat.Checked) { listData = Helper.Repeat(list1, list2); } else { listData = Helper.Difference(list1, list2); } resultFrm frm = new resultFrm(); frm.list = listData; frm.ShowDialog(); }