作业帮 > 综合 > 作业

2、请设计一个程序,程序包括下列功能:(1) 让用户依次输入两个字符串s1和s2; (2) 比较两个字符串的长度

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/05/17 00:09:11
2、请设计一个程序,程序包括下列功能:(1) 让用户依次输入两个字符串s1和s2; (2) 比较两个字符串的长度
(2) 比较两个字符串的长度并显示比较结果;
(3) 判断s1与s2有没有长度在 3个字符以上的相同子串,显示判断结果.
2、请设计一个程序,程序包括下列功能:(1) 让用户依次输入两个字符串s1和s2; (2) 比较两个字符串的长度
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace comparestringandsubstring
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string strsmall="",strbig,sub="";
SortedList substring = new SortedList();
if ((textBox1.Text.Length