C#
CongJiYong
这个作者很懒,什么都没留下…
展开
-
c#
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 { publi原创 2020-09-28 11:44:09 · 75 阅读 · 0 评论 -
C#字符串过滤重复字符
过滤字符串重复字符 aaabbbccc显示结果为abc int j=0; string text=""; private void button1_Click(object sender, EventArgs e) { String s = textBox1.Text; //获取输入的字符串 j = s.Length; //循环次数 text += s[0];//获取第一个字符原创 2020-09-23 15:00:10 · 573 阅读 · 0 评论 -
C#foreach遍历数组
/* * foreach只能从前往后遍历;每次都遍历整个数组 不能遍历一部分 * foreach只知道元素值,不能获取到下标,且元素值只读 * */ foreach (数组类型; 遍历++变量; 遍历数组){ } int[] a = { 1, 2, 3, 4 }; foreac..原创 2020-09-23 14:18:35 · 867 阅读 · 0 评论 -
C#数组sort排序输入数据,输出到文本框
int[] a = new int[5]; int i = 0; private void button2_Click(object sender, EventArgs e) { a[i] = int.Parse(textBox1.Text); //输入数据到数组 textBox2.Text = textBox2.Text + a[i] + " "; i = i...原创 2020-09-21 11:11:05 · 839 阅读 · 0 评论