C#数据结构串的常用实例源码.

时间:2018-08-04 02:46:50
【文件属性】:

文件名称:C#数据结构串的常用实例源码.

文件大小:38KB

文件格式:ZIP

更新时间:2018-08-04 02:46:50

字符串应用

字符串的相加,检索,替换,截取,插入,计算长度 private void button1_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); string b = textBox2.Text.ToString(); string c = a + b; textBox3.Text = c; } private void button2_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); textBox3.Text = a.Length.ToString(); } private void button3_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); string b = textBox2.Text.ToString(); textBox3.Text = b.Insert(0, a); } private void button4_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); int b = Convert.ToInt16(textBox2.Text.Trim()); textBox3.Text = a.Remove(b); } private void button5_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); string b = textBox2.Text.ToString(); string c = textBox3.Text.ToString(); textBox3.Text = a.Replace(b,c); } private void button6_Click(object sender, EventArgs e) { string a = textBox1.Text.ToString(); int b = Convert.ToInt16(textBox2.Text.Trim()); int c = Convert.ToInt16(textBox3.Text.Trim()); textBox3.Text = a.Substring(b, c); }


【文件预览】:
WindowsApplication1
----WindowsApplication1.sln(946B)
----WindowsApplication1.suo(13KB)
----WindowsApplication1()
--------Form1.cs(2KB)
--------Program.cs(478B)
--------Form1.resx(6KB)
--------Properties()
--------Form1.Designer.cs(11KB)
--------WindowsApplication1.csproj(3KB)
--------obj()
--------bin()

网友评论